From 0afd33e4c51ca1f19d041d1504bc35600b2786e6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 3 Apr 2012 18:28:08 -0700 Subject: Markdown writer: don't replace empty alt in image with "image". Previously `` would be translated as `![image](empty.png)`; now it becomes `![](empty.png)` as one might naturally expect. --- src/Text/Pandoc/Writers/Markdown.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Text') 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 -- cgit v1.2.3