diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2017-12-18 14:24:16 +0100 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2017-12-18 18:10:08 +0100 |
commit | 70dc5834da16680caedef4727b1d7f335f0b5427 (patch) | |
tree | 3b0d73b5648e9bd9fcdbdc7f1089975140d4d128 /src/Text/Pandoc/Lua/PandocModule.hs | |
parent | 808f6d3fa1816401d9eb1d6a5d1821fb783cc1d5 (diff) | |
download | pandoc-70dc5834da16680caedef4727b1d7f335f0b5427.tar.gz |
Lua filters: perform minor code clean-up
Change: minor
Diffstat (limited to 'src/Text/Pandoc/Lua/PandocModule.hs')
-rw-r--r-- | src/Text/Pandoc/Lua/PandocModule.hs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Lua/PandocModule.hs b/src/Text/Pandoc/Lua/PandocModule.hs index 75f884c46..6bc2618fd 100644 --- a/src/Text/Pandoc/Lua/PandocModule.hs +++ b/src/Text/Pandoc/Lua/PandocModule.hs @@ -71,16 +71,13 @@ pushPandocModule datadir = do return 1 walkElement :: (ToLuaStack a, Walkable [Inline] a, Walkable [Block] a) - => a -> LuaFilter -> Lua NumResults -walkElement x f = do - x' <- walkInlines f x >>= walkBlocks f - Lua.push x' - return 1 + => a -> LuaFilter -> Lua a +walkElement x f = walkInlines f x >>= walkBlocks f -walkInline :: Inline -> LuaFilter -> Lua NumResults +walkInline :: Inline -> LuaFilter -> Lua Inline walkInline = walkElement -walkBlock :: Block -> LuaFilter -> Lua NumResults +walkBlock :: Block -> LuaFilter -> Lua Block walkBlock = walkElement readDoc :: String -> String -> Lua NumResults |