aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-04-03 18:28:08 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-04-03 18:28:08 -0700
commit0afd33e4c51ca1f19d041d1504bc35600b2786e6 (patch)
tree8f9b9d3fff948a84fd933b88ff69f8e8a031627c /src/Text
parent30a99ecb7c03c391828ccfbed10b9fddbf4a85fb (diff)
downloadpandoc-0afd33e4c51ca1f19d041d1504bc35600b2786e6.tar.gz
Markdown writer: don't replace empty alt in image with "image".
Previously `<img src="empty.png" alt=""/>` would be translated as `![image](empty.png)`; now it becomes `![](empty.png)` as one might naturally expect.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 7ce939395..9a51dfdcb 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -516,9 +516,9 @@ inlineToMarkdown opts (Link txt (src, tit)) = do
else "[" <> linktext <> "](" <>
text src <> linktitle <> ")"
inlineToMarkdown opts (Image alternate (source, tit)) = do
- let txt = if (null alternate) || (alternate == [Str ""]) ||
- (alternate == [Str source]) -- to prevent autolinks
- then [Str "image"]
+ let txt = if null alternate || alternate == [Str source]
+ -- to prevent autolinks
+ then [Str ""]
else alternate
linkPart <- inlineToMarkdown opts (Link txt (source, tit))
return $ "!" <> linkPart