HTML writer: stringify alt text.
Previously, if you had formatting in the label of an Image element, you'd get escaped HTML in the alt attribute. Now you just get a plain string version, which seems preferable.
This commit is contained in:
parent
798c5d55bb
commit
6c0e86d144
2 changed files with 6 additions and 2 deletions
|
@ -38,4 +38,9 @@ tests = [ testGroup "inline code"
|
||||||
, "nolanguage" =: codeWith ("",["nolanguage"],[]) ">>="
|
, "nolanguage" =: codeWith ("",["nolanguage"],[]) ">>="
|
||||||
=?> "<code class=\"nolanguage\">>>=</code>"
|
=?> "<code class=\"nolanguage\">>>=</code>"
|
||||||
]
|
]
|
||||||
|
, testGroup "images"
|
||||||
|
[ "alt with formatting" =:
|
||||||
|
image "/url" "title" ("my " +++ emph "image")
|
||||||
|
=?> "<img src=\"/url\" title=\"title\" alt=\"my image\" />"
|
||||||
|
]
|
||||||
]
|
]
|
||||||
|
|
|
@ -602,8 +602,7 @@ inlineToHtml opts inline =
|
||||||
if null tit then [] else [title tit]) $
|
if null tit then [] else [title tit]) $
|
||||||
linkText
|
linkText
|
||||||
(Image txt (s,tit)) -> do
|
(Image txt (s,tit)) -> do
|
||||||
alternate <- inlineListToHtml opts txt
|
let alternate' = stringify txt
|
||||||
let alternate' = showHtmlFragment alternate
|
|
||||||
let attributes = [src s] ++
|
let attributes = [src s] ++
|
||||||
(if null tit
|
(if null tit
|
||||||
then []
|
then []
|
||||||
|
|
Loading…
Reference in a new issue