@@ -160,6 +160,7 @@ pushBlock = \case
160160 CodeBlock attr code -> pushViaConstructor " CodeBlock" code (LuaAttr attr)
161161 DefinitionList items -> pushViaConstructor " DefinitionList" items
162162 Div attr blcks -> pushViaConstructor " Div" blcks (LuaAttr attr)
163+ Figure attr capt blcks -> pushViaConstructor " Figure" blcks capt (LuaAttr attr)
163164 Header lvl attr inlns -> pushViaConstructor " Header" lvl inlns (LuaAttr attr)
164165 HorizontalRule -> pushViaConstructor " HorizontalRule"
165166 LineBlock blcks -> pushViaConstructor " LineBlock" blcks
@@ -171,7 +172,6 @@ pushBlock = \case
171172 RawBlock f cs -> pushViaConstructor " RawBlock" f cs
172173 Table attr blkCapt specs thead tbody tfoot ->
173174 pushViaConstructor " Table" blkCapt specs thead tbody tfoot attr
174- Figure {} -> undefined -- pushViaConstructor "Figure" capt body attr
175175
176176-- | Return the value at the given index as block if possible.
177177peekBlock :: StackIndex -> Lua Block
@@ -183,6 +183,8 @@ peekBlock idx = defineHowTo "get Block value" $! do
183183 " CodeBlock" -> withAttr CodeBlock <$!> elementContent
184184 " DefinitionList" -> DefinitionList <$!> elementContent
185185 " Div" -> withAttr Div <$!> elementContent
186+ " Figure" -> (\ (LuaAttr attr, capt, bs) -> Figure attr capt bs)
187+ <$!> elementContent
186188 " Header" -> (\ (lvl, LuaAttr attr, lst) -> Header lvl attr lst)
187189 <$!> elementContent
188190 " HorizontalRule" -> return HorizontalRule
0 commit comments