aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Filter
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Filter')
-rw-r--r--src/Text/Pandoc/Filter/JSON.hs5
-rw-r--r--src/Text/Pandoc/Filter/Lua.hs10
2 files changed, 5 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Filter/JSON.hs b/src/Text/Pandoc/Filter/JSON.hs
index 97b291603..2846e42e2 100644
--- a/src/Text/Pandoc/Filter/JSON.hs
+++ b/src/Text/Pandoc/Filter/JSON.hs
@@ -44,7 +44,6 @@ import System.FilePath ((</>), takeExtension)
import Text.Pandoc.Class (PandocIO)
import Text.Pandoc.Error (PandocError (PandocFilterError))
import Text.Pandoc.Definition (Pandoc)
-import Text.Pandoc.Filter.Path (expandFilterPath)
import Text.Pandoc.Options (ReaderOptions)
import Text.Pandoc.Process (pipeProcess)
import Text.Pandoc.Shared (pandocVersion)
@@ -56,9 +55,7 @@ apply :: ReaderOptions
-> FilePath
-> Pandoc
-> PandocIO Pandoc
-apply ropts args f d = do
- f' <- expandFilterPath f
- liftIO $ externalFilter ropts f' args d
+apply ropts args f = liftIO . externalFilter ropts f args
externalFilter :: MonadIO m
=> ReaderOptions -> FilePath -> [String] -> Pandoc -> m Pandoc
diff --git a/src/Text/Pandoc/Filter/Lua.hs b/src/Text/Pandoc/Filter/Lua.hs
index a6dc7b6cc..e5c34c71c 100644
--- a/src/Text/Pandoc/Filter/Lua.hs
+++ b/src/Text/Pandoc/Filter/Lua.hs
@@ -36,7 +36,6 @@ import Control.Monad ((>=>))
import Text.Pandoc.Class (PandocIO)
import Text.Pandoc.Definition (Pandoc)
import Text.Pandoc.Error (PandocError (PandocFilterError))
-import Text.Pandoc.Filter.Path (expandFilterPath)
import Text.Pandoc.Lua (Global (..), LuaException (..),
runLua, runFilterFile, setGlobals)
import Text.Pandoc.Options (ReaderOptions)
@@ -49,17 +48,16 @@ apply :: ReaderOptions
-> FilePath
-> Pandoc
-> PandocIO Pandoc
-apply ropts args f doc = do
- filterPath <- expandFilterPath f
+apply ropts args fp doc = do
let format = case args of
(x:_) -> x
_ -> error "Format not supplied for Lua filter"
- runLua >=> forceResult filterPath $ do
+ runLua >=> forceResult fp $ do
setGlobals [ FORMAT format
, PANDOC_READER_OPTIONS ropts
- , PANDOC_SCRIPT_FILE filterPath
+ , PANDOC_SCRIPT_FILE fp
]
- runFilterFile filterPath doc
+ runFilterFile fp doc
forceResult :: FilePath -> Either LuaException Pandoc -> PandocIO Pandoc
forceResult fp eitherResult = case eitherResult of