git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: stringify alt text.
6c0e86dJohn MacFarlane
src/Tests/Writers/HTML.hs+5
@@ -38,4 +38,9 @@ tests = [ testGroup "inline code"
38 , "nolanguage" =: codeWith ("",["nolanguage"],[]) ">>="
38 , "nolanguage" =: codeWith ("",["nolanguage"],[]) ">>="
39 =?> "<code class=\"nolanguage\">&gt;&gt;=</code>"
39 =?> "<code class=\"nolanguage\">&gt;&gt;=</code>"
40 ]
40 ]
41+ , testGroup "images"
42+ [ "alt with formatting" =:
43+ image "/url" "title" ("my " +++ emph "image")
44+ =?> "<img src=\"/url\" title=\"title\" alt=\"my image\" />"
45+ ]
41 ]
46 ]
src/Text/Pandoc/Writers/HTML.hs+1−2
@@ -602,8 +602,7 @@ inlineToHtml opts inline =
602 if null tit then [] else [title tit]) $
602 if null tit then [] else [title tit]) $
603 linkText
603 linkText
604 (Image txt (s,tit)) -> do
604 (Image txt (s,tit)) -> do
605− alternate <- inlineListToHtml opts txt
605+ let alternate' = stringify txt
606− let alternate' = showHtmlFragment alternate
607 let attributes = [src s] ++
606 let attributes = [src s] ++
608 (if null tit
607 (if null tit
609 then []
608 then []