@@ -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 ()