From 371f9b708478700992a74864985cfea0af2fd4c3 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 3 Oct 2017 20:45:11 +0200 Subject: pandoc.lua: use wrapper funciton for pipe command The pipe command is wrapped in a lua function, throwing a lua error if the command returns with an error. A wrapper is needed as Haskell functions exposed to lua may not throw lua errors due to limitations of hslua. The error handling is written such that a table can be returned as an error object in the future. This is potentially useful when finer control is required while catching the error in lua code. Current limitations of hslua require error objects to be strings. --- src/Text/Pandoc/Lua/PandocModule.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Lua/PandocModule.hs b/src/Text/Pandoc/Lua/PandocModule.hs index c689edc4e..f9b072dff 100644 --- a/src/Text/Pandoc/Lua/PandocModule.hs +++ b/src/Text/Pandoc/Lua/PandocModule.hs @@ -63,7 +63,7 @@ pushPandocModule datadir = do script <- liftIO (pandocModuleScript datadir) status <- Lua.loadstring script unless (status /= Lua.OK) $ Lua.call 0 1 - addFunction "pipe" pipeFn + addFunction "_pipe" pipeFn addFunction "_read" readDoc addFunction "sha1" sha1HashFn -- cgit v1.2.3