diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2017-03-24 21:19:55 +0100 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2017-03-24 21:31:35 +0100 |
commit | 1e13e98ecfba2d78a88ba42bb54c8cdc15929e2d (patch) | |
tree | b61810b5eeba033c49963f67a0984227cfa26677 /src/Text/Pandoc/Writers | |
parent | 14e7d3dbfff30af2ffde149dac860a736030673b (diff) | |
download | pandoc-1e13e98ecfba2d78a88ba42bb54c8cdc15929e2d.tar.gz |
Ensure compatibility with hslua 0.5.*
The 0.5.0 release of hslua fixes problems with lua C modules on linux.
The signature of the `loadstring` function changed, so a compatibility
wrapper is introduced to allow both 0.4.* and 0.5.* versions to be used.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/Custom.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Custom.hs b/src/Text/Pandoc/Writers/Custom.hs index d7374b68b..9bed1dcd3 100644 --- a/src/Text/Pandoc/Writers/Custom.hs +++ b/src/Text/Pandoc/Writers/Custom.hs @@ -47,6 +47,7 @@ import Data.Typeable import GHC.IO.Encoding (getForeignEncoding, setForeignEncoding, utf8) import Scripting.Lua (LuaState, StackValue, callfunc) import qualified Scripting.Lua as Lua +import Text.Pandoc.Lua.Compat ( loadstring ) import Text.Pandoc.Definition import Text.Pandoc.Options import Text.Pandoc.Templates @@ -186,7 +187,7 @@ writeCustom luaFile opts doc@(Pandoc meta _) = do setForeignEncoding utf8 lua <- Lua.newstate Lua.openlibs lua - status <- Lua.loadstring lua luaScript luaFile + status <- loadstring lua luaScript luaFile -- check for error in lua script (later we'll change the return type -- to handle this more gracefully): when (status /= 0) $ |