git.iko.soy/typeable/pandoc
on master help sign in
App: reverse optInputFiles so they come out in right order in templates.
737d954John MacFarlane
src/Text/Pandoc/App.hs+5−1
@@ -233,7 +233,11 @@ convertWithOpts opts = do
233 (\vars -> return $ ("outputfile", optOutputFile opts) : vars)
233 (\vars -> return $ ("outputfile", optOutputFile opts) : vars)
234 >>=
234 >>=
235 withList (addStringAsVariable "sourcefile")
235 withList (addStringAsVariable "sourcefile")
236− (optInputFiles opts)
236+ (reverse $ optInputFiles opts)
237+ -- we reverse this list because, unlike
238+ -- the other option lists here, it is
239+ -- not reversed when parsed from CLI arguments.
240+ -- See withList, above.
237 >>=
241 >>=
238 withList (addContentsAsVariable "include-before")
242 withList (addContentsAsVariable "include-before")
239 (optIncludeBeforeBody opts)
243 (optIncludeBeforeBody opts)