@@ -44,7 +44,7 @@ import Foreign.Lua.Api
44import Text.Pandoc.Class (PandocIO)
44import Text.Pandoc.Class (PandocIO)
45import Text.Pandoc.Definition
45import Text.Pandoc.Definition
46import Text.Pandoc.Error
46import Text.Pandoc.Error
47−import Text.Pandoc.Lua.Init (runPandocLua)
47+import Text.Pandoc.Lua.Init (runPandocLua, registerScriptPath)
48import Text.Pandoc.Lua.StackInstances ()
48import Text.Pandoc.Lua.StackInstances ()
49import Text.Pandoc.Lua.Util (addValue, dostring')
49import Text.Pandoc.Lua.Util (addValue, dostring')
50import Text.Pandoc.Options
50import Text.Pandoc.Options
@@ -106,6 +106,7 @@ writeCustom :: FilePath -> WriterOptions -> Pandoc -> PandocIO Text
106writeCustom luaFile opts doc@(Pandoc meta _) = do
106writeCustom luaFile opts doc@(Pandoc meta _) = do
107 luaScript <- liftIO $ UTF8.readFile luaFile
107 luaScript <- liftIO $ UTF8.readFile luaFile
108 res <- runPandocLua $ do
108 res <- runPandocLua $ do
109+ registerScriptPath luaFile
109 stat <- dostring' luaScript
110 stat <- dostring' luaScript
110 -- check for error in lua script (later we'll change the return type
111 -- check for error in lua script (later we'll change the return type
111 -- to handle this more gracefully):
112 -- to handle this more gracefully):