aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2017-04-16 21:00:01 +0200
committerAlbert Krewinkel <albert+github@zeitkraut.de>2017-04-26 23:28:40 +0200
commit5416fb14aba9804ce4a227a4ebd8228d82aa658e (patch)
treed929ae7db65b2191fe69af750c9738e57b6803ce /src
parenta29fa15a7b214ff83efe7b32fe51a55711984ef7 (diff)
downloadpandoc-5416fb14aba9804ce4a227a4ebd8228d82aa658e.tar.gz
Lua filter: allow natural access to meta elements
Meta elements that are treated as lua tables (i.e. MetaList, MetaInlines, MetaBlocks, and MetaMap), are no longer wrapped in an additional table but simply marked via a metatable. This allows treating those meta values just like normal tables, while still making empty elements of those values distinguishable.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Lua/StackInstances.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Lua/StackInstances.hs b/src/Text/Pandoc/Lua/StackInstances.hs
index 9ba28b58e..52151ce64 100644
--- a/src/Text/Pandoc/Lua/StackInstances.hs
+++ b/src/Text/Pandoc/Lua/StackInstances.hs
@@ -140,7 +140,7 @@ peekMetaValue :: LuaState -> Int -> IO (Maybe MetaValue)
peekMetaValue lua idx = do
-- Get the contents of an AST element.
let elementContent :: StackValue a => IO (Maybe a)
- elementContent = getTable lua idx "c"
+ elementContent = peek lua idx
luatype <- ltype lua idx
case luatype of
TBOOLEAN -> fmap MetaBool <$> peek lua idx