aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/App.hs4
-rw-r--r--src/Text/Pandoc/App/CommandLineOptions.hs2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index ed5963f1a..f3d342ebf 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -231,6 +231,10 @@ convertWithOpts opts = do
[] -> return mempty
paths -> mapM readFileLazy paths >>= mapM (yamlToMeta readerOpts)
>>= return . (foldr1 (<>))
+ -- Note: this list is in reverse order from the order on the
+ -- command line. So this code ensures that metadata files
+ -- specified later in the command line take precedence over
+ -- those specified earlier.
let transforms = (case optShiftHeadingLevelBy opts of
0 -> id
diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs
index f9f825a44..a7b20a6e3 100644
--- a/src/Text/Pandoc/App/CommandLineOptions.hs
+++ b/src/Text/Pandoc/App/CommandLineOptions.hs
@@ -209,7 +209,7 @@ options =
, Option "" ["metadata-file"]
(ReqArg
(\arg opt -> return opt{ optMetadataFile =
- (optMetadataFile opt) <> [normalizePath arg] })
+ normalizePath arg : optMetadataFile opt })
"FILE")
""