aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-09-18 01:35:50 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-09-18 01:35:50 +0000
commitf8eac5b3776c4fdb2ddfc5ba9c8656b54b6e8673 (patch)
treecaaeb03eb692b293b6c4f5aa574511b48dbf6751
parentfbb048238ef25616b9f288535101a360630f624e (diff)
downloadpandoc-f8eac5b3776c4fdb2ddfc5ba9c8656b54b6e8673.tar.gz
Markdown writer: Don't print title attribute if title is empty.
(This differs from the behavior of Markdown.pl, and agrees with PHP Markdown. But John Gruber has indicated that he prefers this behavior.) Adjusted test suite accordingly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1026 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs5
-rw-r--r--tests/writer.html2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index f554d4887..43c3cce4b 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -407,7 +407,10 @@ inlineToHtml opts inline =
(Image txt (source,tit)) -> do
alternate <- inlineListToHtml opts txt
let alternate' = renderHtmlFragment alternate
- let attributes = [src source, title tit] ++
+ let attributes = [src source] ++
+ (if null tit
+ then []
+ else [title tit]) ++
if null txt
then []
else [alt alternate']
diff --git a/tests/writer.html b/tests/writer.html
index 9a6f7cecc..c461522d5 100644
--- a/tests/writer.html
+++ b/tests/writer.html
@@ -1033,7 +1033,7 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+
><img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune"
/></p
><p
- >Here is a movie <img src="movie.jpg" title="" alt="movie"
+ >Here is a movie <img src="movie.jpg" alt="movie"
/> icon.</p
><hr
/><h1 id="footnotes"