aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-03-11 00:19:15 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-03-11 00:19:15 +0000
commit2e794fdf37dce8dd1ab5e385b5b3e38bef5f4364 (patch)
tree75225e48dd4c8bcd2c7153c39b68037fa9a8ae8e /src/Text/Pandoc/Writers/HTML.hs
parent115cad888245179e4a455a74dd4d8139a760f776 (diff)
downloadpandoc-2e794fdf37dce8dd1ab5e385b5b3e38bef5f4364.tar.gz
Fixed bug in HTML email obfuscation using --strict mode.
The problem is that the "href" function escapes &, so (href "&#108;") is 'href="&amp;#108;"'. Fixed by using primHtml for the whole link. Resolves issue 9. git-svn-id: https://pandoc.googlecode.com/svn/trunk@569 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 8c31f12da..f4861fe0b 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -106,7 +106,9 @@ obfuscateLink opts txt src =
else text' ++ " (" ++ name ++ " at " ++
domain' ++ ")" in
if writerStrictMarkdown opts
- then anchor ! [href $ obfuscateString src'] << obfuscateString text'
+ then -- need to use primHtml or &'s are escaped to &amp; in URL
+ primHtml $ "<a href=\"" ++ (obfuscateString src')
+ ++ "\">" ++ (obfuscateString text') ++ "</a>"
else (script ! [thetype "text/javascript"] $
primHtml ("\n<!--\nh='" ++
obfuscateString domain ++ "';a='" ++ at' ++ "';n='" ++