git.iko.soy/typeable/pandoc
on master help sign in
Lua: set "arg" instead of "PandocParameters".

This is standard for lua scripts, and I see no reason to depart from the standard here. Also, "arg" is now pushed onto the stack before the script is loaded. Previously it was not, and thus "PandocParameters" was not available at the top level.

commit3fe4aad5a16545a92088510a00d2109a04fd25b8 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 26 Sep 2017, 10:05 (9 years ago) parent2cdb8fe
1 file changed+2−2
src/Text/Pandoc/Lua.hs+2−2
src/Text/Pandoc/Lua.hs+2−2
@@ -57,6 +57,8 @@ runLuaFilter datadir filterPath args pd = liftIO . Lua.runLua $ do
5757 -- store module in global "pandoc"
5858 pushPandocModule datadir
5959 Lua.setglobal "pandoc"
60+ push args
61+ Lua.setglobal "arg"
6062 top <- Lua.gettop
6163 stat <- Lua.dofile filterPath
6264 if stat /= OK
@@ -68,8 +70,6 @@ runLuaFilter datadir filterPath args pd = liftIO . Lua.runLua $ do
6870 -- Use the implicitly defined global filter if nothing was returned
6971 when (newtop - top < 1) pushGlobalFilter
7072 luaFilters <- peek (-1)
71− push args
72− Lua.setglobal "PandocParameters"
7373 runAll luaFilters pd
7474
7575pushGlobalFilter :: Lua ()