git.iko.soy/typeable/pandoc
on master help sign in
Modified HTML output for Image elements, to conform to
f2c2494fiddlosopher
src/Text/Pandoc/Writers/HTML.hs+3−3
@@ -230,9 +230,9 @@ inlineToHtml opts (Link txt (Ref ref)) =
230inlineToHtml opts (Image alt (Src source tit)) =
230inlineToHtml opts (Image alt (Src source tit)) =
231 let title = stringToSGML tit
231 let title = stringToSGML tit
232 alternate = render $ inlineListToHtml opts alt in
232 alternate = render $ inlineListToHtml opts alt in
233− selfClosingTag "img" $ [("src", source)] ++
233+ selfClosingTag "img" $ [("src", source)] ++
234− (if null tit then [] else [("title", title)]) ++
235− (if null alternate then [] else [("alt", alternate)])
234+ (if null alternate then [] else [("alt", alternate)]) ++
235+ [("title", title)] -- note: null title is included, as in Markdown.pl
236inlineToHtml opts (Image alternate (Ref ref)) =
236inlineToHtml opts (Image alternate (Ref ref)) =
237 text "![" <> (inlineListToHtml opts alternate) <> text "][" <>
237 text "![" <> (inlineListToHtml opts alternate) <> text "][" <>
238 (inlineListToHtml opts ref) <> char ']'
238 (inlineListToHtml opts ref) <> char ']'
tests/writer.html+2−2
@@ -751,10 +751,10 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
751 From &ldquo;Voyage dans la Lune&rdquo; by Georges Melies (1902):
751 From &ldquo;Voyage dans la Lune&rdquo; by Georges Melies (1902):
752</p>
752</p>
753<p>
753<p>
754− <img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune" />
754+ <img src="lalune.jpg" alt="lalune" title="Voyage dans la Lune" />
755</p>
755</p>
756<p>
756<p>
757− Here is a movie <img src="movie.jpg" alt="movie" /> icon.
757+ Here is a movie <img src="movie.jpg" alt="movie" title="" /> icon.
758</p>
758</p>
759<hr />
759<hr />
760<h1>Footnotes</h1>
760<h1>Footnotes</h1>