diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-06-27 15:25:37 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-06-27 15:25:37 +0200 |
commit | 7d9d77ca44afa0c69abfefe07d7b027f81c8f1a0 (patch) | |
tree | 05c7d829467e7d3831fb2876e204f494f3f9f9a2 /src/Text/Pandoc/Readers | |
parent | 33a29fbf8720c0d7eec40b7014e3f819b05474ef (diff) | |
download | pandoc-7d9d77ca44afa0c69abfefe07d7b027f81c8f1a0.tar.gz |
Require nonempty alt text for `implicit_figures`.
A figure with an empty caption doesn't make sense.
Closes #2844.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 31b51f237..49007ad35 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1035,7 +1035,8 @@ para = try $ do result' <- result case B.toList result' of [Image attr alt (src,tit)] - | Ext_implicit_figures `extensionEnabled` exts -> + | not (null alt) && + Ext_implicit_figures `extensionEnabled` exts -> -- the fig: at beginning of title indicates a figure return $ B.para $ B.singleton $ Image attr alt (src,'f':'i':'g':':':tit) |