git.iko.soy/typeable/pandoc
on master help sign in
Modified HTML output for Image elements, to conform to

Markdown.pl: + title attribute comes after alt attribute + title is included even if null git-svn-id: https://pandoc.googlecode.com/svn/trunk@445 788f1e2b-df1e-0410-8736-df70ead52e1b

commitf2c2494b66e3577c43e910ea19152d7d4d1c2f49 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 7 Jan 2007, 01:06 (20 years ago) parent1bc5858
2 files changed+5−5
src/Text/Pandoc/Writers/HTML.hs+3−3 tests/writer.html+2−2
src/Text/Pandoc/Writers/HTML.hs+3−3
@@ -230,9 +230,9 @@ inlineToHtml opts (Link txt (Ref ref)) =
230230inlineToHtml opts (Image alt (Src source tit)) =
231231 let title = stringToSGML tit
232232 alternate = render $ inlineListToHtml opts alt in
233− selfClosingTag "img" $ [("src", source)] ++
234− (if null tit then [] else [("title", title)]) ++
235− (if null alternate then [] else [("alt", alternate)])
233+ selfClosingTag "img" $ [("src", source)] ++
234+ (if null alternate then [] else [("alt", alternate)]) ++
235+ [("title", title)] -- note: null title is included, as in Markdown.pl
236236inlineToHtml opts (Image alternate (Ref ref)) =
237237 text "![" <> (inlineListToHtml opts alternate) <> text "][" <>
238238 (inlineListToHtml opts ref) <> char ']'
tests/writer.html+2−2
@@ -751,10 +751,10 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
751751 From &ldquo;Voyage dans la Lune&rdquo; by Georges Melies (1902):
752752</p>
753753<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" />
755755</p>
756756<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.
758758</p>
759759<hr />
760760<h1>Footnotes</h1>