From 737d954a59fb8a783d4eb6462c9e11b9e1d07402 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 25 Feb 2017 23:47:19 +0100 Subject: [PATCH] App: reverse optInputFiles so they come out in right order in templates. --- src/Text/Pandoc/App.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)