aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-06-27 15:25:37 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-06-27 15:25:37 +0200
commit7d9d77ca44afa0c69abfefe07d7b027f81c8f1a0 (patch)
tree05c7d829467e7d3831fb2876e204f494f3f9f9a2 /src/Text/Pandoc
parent33a29fbf8720c0d7eec40b7014e3f819b05474ef (diff)
downloadpandoc-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')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs3
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)