aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-02-25 23:47:19 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-02-25 23:47:19 +0100
commit737d954a59fb8a783d4eb6462c9e11b9e1d07402 (patch)
tree514601662305d8e412fa6a52f4e24757cab62861 /src
parent4aed13bf7c746c34d0cd4d5a3cea94f2ee9b73f8 (diff)
downloadpandoc-737d954a59fb8a783d4eb6462c9e11b9e1d07402.tar.gz
App: reverse optInputFiles so they come out in right order in templates.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/App.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index 9d8fc592b..8c11a0ff7 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -233,7 +233,11 @@ convertWithOpts opts = do
(\vars -> return $ ("outputfile", optOutputFile opts) : vars)
>>=
withList (addStringAsVariable "sourcefile")
- (optInputFiles opts)
+ (reverse $ optInputFiles opts)
+ -- we reverse this list because, unlike
+ -- the other option lists here, it is
+ -- not reversed when parsed from CLI arguments.
+ -- See withList, above.
>>=
withList (addContentsAsVariable "include-before")
(optIncludeBeforeBody opts)