aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-11-06 15:41:30 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-11-06 15:42:41 -0800
commite299212bf766cdbeec43be90f634038ab4a727c1 (patch)
treeddf01436166c6bd313719a8009eb2639108e360f /src/Text/Pandoc/App
parentadad3c70b6d68563f2dad5136705fcaa33d719ea (diff)
downloadpandoc-e299212bf766cdbeec43be90f634038ab4a727c1.tar.gz
Add and apply filters in order (not reversed).
This changes `applyFilters` from Text.Pandoc.Filter so that it does a left fold rather than a right fold, applying the filters in the order listed. [behavior change] The command-line arguments are accumulated in order instead of reverse order. A first step twoards #5881.
Diffstat (limited to 'src/Text/Pandoc/App')
-rw-r--r--src/Text/Pandoc/App/CommandLineOptions.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs
index 848f9fba5..7692cfac9 100644
--- a/src/Text/Pandoc/App/CommandLineOptions.hs
+++ b/src/Text/Pandoc/App/CommandLineOptions.hs
@@ -436,16 +436,14 @@ options =
, Option "F" ["filter"]
(ReqArg
(\arg opt -> return opt { optFilters =
- JSONFilter (normalizePath arg) :
- optFilters opt })
+ optFilters opt ++ [JSONFilter (normalizePath arg)] })
"PROGRAM")
"" -- "External JSON filter"
, Option "L" ["lua-filter"]
(ReqArg
(\arg opt -> return opt { optFilters =
- LuaFilter (normalizePath arg) :
- optFilters opt })
+ optFilters opt ++ [LuaFilter (normalizePath arg)] })
"SCRIPTPATH")
"" -- "Lua filter"