From f8eac5b3776c4fdb2ddfc5ba9c8656b54b6e8673 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 18 Sep 2007 01:35:50 +0000 Subject: 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 --- src/Text/Pandoc/Writers/HTML.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Text') 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'] -- cgit v1.2.3