diff options
| author | John MacFarlane <[email protected]> | 2017-08-19 22:19:21 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2017-08-19 22:19:45 -0700 |
| commit | f11a4b65ad6b7d878327320c9d3ce6a9a1a7fd0f (patch) | |
| tree | 233141fd53b6e3fbb961adc1dd817529aebfa0b8 | |
| parent | dd1db8596e25747681e249ce6b8781d598691cc5 (diff) | |
Lua StackInstance for Figure.
Shared.blocksToInlines for Figure.
| -rw-r--r-- | src/Text/Pandoc/Lua/StackInstances.hs | 12 | ||||
| -rw-r--r-- | src/Text/Pandoc/Shared.hs | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Lua/StackInstances.hs b/src/Text/Pandoc/Lua/StackInstances.hs index 15a7cdd84..e1b362e2b 100644 --- a/src/Text/Pandoc/Lua/StackInstances.hs +++ b/src/Text/Pandoc/Lua/StackInstances.hs @@ -185,10 +185,15 @@ pushBlock :: Block -> Lua () pushBlock = \case BlockQuote blcks -> pushViaConstructor "BlockQuote" blcks BulletList items -> pushViaConstructor "BulletList" items - CodeBlock attr code -> pushViaConstructor "CodeBlock" code (LuaAttr attr) + CodeBlock attr code -> pushViaConstructor "CodeBlock" code + (LuaAttr attr) DefinitionList items -> pushViaConstructor "DefinitionList" items Div attr blcks -> pushViaConstructor "Div" blcks (LuaAttr attr) - Header lvl attr inlns -> pushViaConstructor "Header" lvl inlns (LuaAttr attr) + Figure attr (Caption short long) blcks + -> pushViaConstructor "Figure" short long blcks + (LuaAttr attr) + Header lvl attr inlns -> pushViaConstructor "Header" lvl inlns + (LuaAttr attr) HorizontalRule -> pushViaConstructor "HorizontalRule" LineBlock blcks -> pushViaConstructor "LineBlock" blcks OrderedList lstAttr list -> pushViaConstructor "OrderedList" list lstAttr @@ -209,6 +214,9 @@ peekBlock idx = do "CodeBlock" -> (withAttr CodeBlock) <$> elementContent "DefinitionList" -> DefinitionList <$> elementContent "Div" -> (withAttr Div) <$> elementContent + "Figure" -> (\(LuaAttr attr, short, long, blks) -> + Figure attr (Caption short long) blks) + <$> elementContent "Header" -> (\(lvl, LuaAttr attr, lst) -> Header lvl attr lst) <$> elementContent "HorizontalRule" -> return HorizontalRule diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 9f88a0ad4..f47274d63 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -764,6 +764,8 @@ blockToInlines (Table _ _ _ headers rows) = where tbl = headers : rows blockToInlines (Div _ blks) = blocksToInlines blks +blockToInlines (Figure _ (Caption _ bs) blks) = + blocksToInlines blks ++ blocksToInlines bs blockToInlines Null = [] blocksToInlinesWithSep :: [Inline] -> [Block] -> [Inline] |
