From a249f75a301a759bd4d2e5f77f4046113c370497 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 16 Apr 2023 13:49:56 +0200 Subject: Lua: fix value of PANDOC_SCRIPT_FILE for custom readers & writers The value did not hold the actual file path for scripts in the *custom* folder of the datadir. Fixes: #8781 --- pandoc-lua-engine/src/Text/Pandoc/Lua/Custom.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pandoc-lua-engine') diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Custom.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Custom.hs index 14029a1d4..0a2eb2edc 100644 --- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Custom.hs +++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Custom.hs @@ -36,7 +36,7 @@ loadCustom luaFile = do luaFile' <- fromMaybe luaFile <$> findFileWithDataFallback "custom" luaFile either throw pure <=< runLuaWith luaState $ do - let globals = [ PANDOC_SCRIPT_FILE luaFile ] + let globals = [ PANDOC_SCRIPT_FILE luaFile' ] setGlobals globals dofileTrace (Just luaFile') >>= \case OK -> pure () -- cgit v1.2.3