aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/CommonMark.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers/CommonMark.hs')
-rw-r--r--src/Text/Pandoc/Readers/CommonMark.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/CommonMark.hs b/src/Text/Pandoc/Readers/CommonMark.hs
index d1f732bf1..c63ea6392 100644
--- a/src/Text/Pandoc/Readers/CommonMark.hs
+++ b/src/Text/Pandoc/Readers/CommonMark.hs
@@ -76,7 +76,12 @@ addBlocks opts = foldr (addBlock opts) []
addBlock :: ReaderOptions -> Node -> [Block] -> [Block]
addBlock opts (Node _ PARAGRAPH nodes) =
- (Para (addInlines opts nodes) :)
+ case addInlines opts nodes of
+ [Image attr alt (src,tit)]
+ | isEnabled Ext_implicit_figures opts
+ -- the "fig:" prefix indicates an implicit figure
+ -> (Para [Image attr alt (src, "fig:" <> tit)] :)
+ ils -> (Para ils :)
addBlock _ (Node _ THEMATIC_BREAK _) =
(HorizontalRule :)
addBlock opts (Node _ BLOCK_QUOTE nodes) =