git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: include needed whitespace after HTML figure.
4060df6John MacFarlane
src/Text/Pandoc/Writers/Markdown.hs+1−1
@@ -463,7 +463,7 @@ blockToMarkdown' opts (Para [Image attr alt (src,'f':'i':'g':':':tit)])
463 | isEnabled Ext_raw_html opts &&
463 | isEnabled Ext_raw_html opts &&
464 not (isEnabled Ext_link_attributes opts) &&
464 not (isEnabled Ext_link_attributes opts) &&
465 attr /= nullAttr = -- use raw HTML
465 attr /= nullAttr = -- use raw HTML
466− (text . T.unpack . T.strip) <$>
466+ ((<> blankline) . text . T.unpack . T.strip) <$>
467 writeHtml5String opts{ writerTemplate = Nothing }
467 writeHtml5String opts{ writerTemplate = Nothing }
468 (Pandoc nullMeta [Para [Image attr alt (src,"fig:" ++ tit)]])
468 (Pandoc nullMeta [Para [Image attr alt (src,"fig:" ++ tit)]])
469 | otherwise = blockToMarkdown opts (Para [Image attr alt (src,tit)])
469 | otherwise = blockToMarkdown opts (Para [Image attr alt (src,tit)])
test/command/5121.mdnew file+13
@@ -0,0 +1,13 @@
1+```
2+% pandoc -f markdown -t markdown_strict
3+![My caption](./my-figure.jpg){width=500px}
4+
5+## Header 2
6+^D
7+<figure>
8+<img src="./my-figure.jpg" alt="My caption" width="500" /><figcaption>My caption</figcaption>
9+</figure>
10+
11+Header 2
12+--------
13+```