From e299212bf766cdbeec43be90f634038ab4a727c1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 6 Nov 2019 15:41:30 -0800 Subject: 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. --- src/Text/Pandoc/App/CommandLineOptions.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/Text/Pandoc/App') 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" -- cgit v1.2.3