aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-07 01:06:34 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-07 01:06:34 +0000
commitf2c2494b66e3577c43e910ea19152d7d4d1c2f49 (patch)
tree22ce0165508d9bf7f71cb24a3d799b188e3c35ae
parent1bc585837c75f9ab21e49e2dccb6bcd905b1a5bc (diff)
downloadpandoc-f2c2494b66e3577c43e910ea19152d7d4d1c2f49.tar.gz
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
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs6
-rw-r--r--tests/writer.html4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 4c869ac21..e119a5c87 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -230,9 +230,9 @@ inlineToHtml opts (Link txt (Ref ref)) =
inlineToHtml opts (Image alt (Src source tit)) =
let title = stringToSGML tit
alternate = render $ inlineListToHtml opts alt in
- selfClosingTag "img" $ [("src", source)] ++
- (if null tit then [] else [("title", title)]) ++
- (if null alternate then [] else [("alt", alternate)])
+ selfClosingTag "img" $ [("src", source)] ++
+ (if null alternate then [] else [("alt", alternate)]) ++
+ [("title", title)] -- note: null title is included, as in Markdown.pl
inlineToHtml opts (Image alternate (Ref ref)) =
text "![" <> (inlineListToHtml opts alternate) <> text "][" <>
(inlineListToHtml opts ref) <> char ']'
diff --git a/tests/writer.html b/tests/writer.html
index 2428d0a12..3213bb9ce 100644
--- a/tests/writer.html
+++ b/tests/writer.html
@@ -751,10 +751,10 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
From &ldquo;Voyage dans la Lune&rdquo; by Georges Melies (1902):
</p>
<p>
- <img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune" />
+ <img src="lalune.jpg" alt="lalune" title="Voyage dans la Lune" />
</p>
<p>
- Here is a movie <img src="movie.jpg" alt="movie" /> icon.
+ Here is a movie <img src="movie.jpg" alt="movie" title="" /> icon.
</p>
<hr />
<h1>Footnotes</h1>