aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/App/Opt.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs
index 4f54bad48..a753d6ab3 100644
--- a/src/Text/Pandoc/App/Opt.hs
+++ b/src/Text/Pandoc/App/Opt.hs
@@ -180,7 +180,9 @@ doOpt (k',v) = do
parseYAML v >>= \x -> return (\o -> o{ optTemplate = unpack <$> x })
"variables" ->
parseYAML v >>= \x -> return (\o -> o{ optVariables =
- optVariables o <> x })
+ x <> optVariables o })
+ -- Note: x comes first because <> for Context is left-biased union
+ -- and we want to favor later default files. See #5988.
"metadata" ->
parseYAML v >>= \x -> return (\o -> o{ optMetadata = optMetadata o <>
contextToMeta x })