@@ -32,7 +32,7 @@ module Text.Pandoc.Writers.HTML (
33import Text.Pandoc.Definition
33import Text.Pandoc.Definition
34import Text.Pandoc.Shared
34import Text.Pandoc.Shared
35−import Text.Pandoc.Entities ( encodeEntities, stringToSGML )
35+import Text.Pandoc.Entities ( encodeEntities )
36import Text.Regex ( mkRegex, matchRegex )
36import Text.Regex ( mkRegex, matchRegex )
37import Numeric ( showHex )
37import Numeric ( showHex )
38import Data.Char ( ord, toLower )
38import Data.Char ( ord, toLower )
@@ -127,11 +127,11 @@ htmlHeader opts (Meta title authors date) =
127 then empty
127 then empty
128 else selfClosingTag "meta" [("name", "author"),
128 else selfClosingTag "meta" [("name", "author"),
129 ("content",
129 ("content",
130− joinWithSep ", " (map stringToSGML authors))]
130+ joinWithSep ", " (map encodeEntities authors))]
131 datetext = if (date == "")
131 datetext = if (date == "")
132 then empty
132 then empty
133 else selfClosingTag "meta" [("name", "date"),
133 else selfClosingTag "meta" [("name", "date"),
134− ("content", stringToSGML date)] in
134+ ("content", encodeEntities date)] in
135 text (writerHeader opts) $$ authortext $$ datetext $$ titletext $$
135 text (writerHeader opts) $$ authortext $$ datetext $$ titletext $$
136 text "</head>\n<body>"
136 text "</head>\n<body>"
@@ -248,20 +248,18 @@ inlineToHtml opts (TeX str) = text $ encodeEntities str
248inlineToHtml opts (HtmlInline str) = text str
248inlineToHtml opts (HtmlInline str) = text str
249inlineToHtml opts (LineBreak) = selfClosingTag "br" []
249inlineToHtml opts (LineBreak) = selfClosingTag "br" []
250inlineToHtml opts Space = space
250inlineToHtml opts Space = space
251−inlineToHtml opts (Link txt (Src src tit)) =
251+inlineToHtml opts (Link txt (Src src title)) =
252− let title = stringToSGML tit in
253 if (isPrefixOf "mailto:" src)
252 if (isPrefixOf "mailto:" src)
254 then obfuscateLink opts txt src
253 then obfuscateLink opts txt src
255− else inTags False "a" ([("href", encodeEntities src)] ++
254+ else inTags False "a" ([("href", src)] ++
256− if null tit then [] else [("title", title)])
255+ if null title then [] else [("title", title)])
257 (inlineListToHtml opts txt)
256 (inlineListToHtml opts txt)
258inlineToHtml opts (Link txt (Ref ref)) =
257inlineToHtml opts (Link txt (Ref ref)) =
259 char '[' <> (inlineListToHtml opts txt) <> text "][" <>
258 char '[' <> (inlineListToHtml opts txt) <> text "][" <>
260 (inlineListToHtml opts ref) <> char ']'
259 (inlineListToHtml opts ref) <> char ']'
261 -- this is what markdown does, for better or worse
260 -- this is what markdown does, for better or worse
262−inlineToHtml opts (Image alt (Src source tit)) =
261+inlineToHtml opts (Image alt (Src source title)) =
263− let title = stringToSGML tit
264− alternate = render $ inlineListToHtml opts alt in
262+ let alternate = render $ inlineListToHtml opts alt in
265 selfClosingTag "img" $ [("src", source)] ++
263 selfClosingTag "img" $ [("src", source)] ++
266 (if null alternate then [] else [("alt", alternate)]) ++
264 (if null alternate then [] else [("alt", alternate)]) ++
267 [("title", title)] -- note: null title is included, as in Markdown.pl
265 [("title", title)] -- note: null title is included, as in Markdown.pl