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.
This commit is contained in:
parent
30a99ecb7c
commit
0afd33e4c5
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue