diff options
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index effede04c..4456a61b5 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -91,12 +91,15 @@ obfuscateLink options text src = then name ++ " at " ++ domain' else text' ++ " (" ++ name ++ " at " ++ domain' ++ ")" in - "<script type=\"text/javascript\">\n<!--\nh='" ++ - obfuscateString domain ++ "';a='" ++ at' ++ "';n='" ++ - obfuscateString name ++ "';e=n+a+h;\n" ++ - "document.write('<a h'+'ref'+'=\"ma'+'ilto'+':'+e+'\">'+" ++ - linkText ++ "+'<\\/'+'a'+'>');\n// -->\n</script><noscript>" ++ - obfuscateString altText ++ "</noscript>" + if writerStrictMarkdown options + then "<a href=\"" ++ obfuscateString src' ++ "\">" ++ + obfuscateString text' ++ "</a>" + else "<script type=\"text/javascript\">\n<!--\nh='" ++ + obfuscateString domain ++ "';a='" ++ at' ++ "';n='" ++ + obfuscateString name ++ "';e=n+a+h;\n" ++ + "document.write('<a h'+'ref'+'=\"ma'+'ilto'+':'+e+'\">'+" ++ + linkText ++ "+'<\\/'+'a'+'>');\n// -->\n</script><noscript>" ++ + obfuscateString altText ++ "</noscript>" _ -> "<a href=\"" ++ src ++ "\">" ++ text' ++ "</a>" -- malformed email -- | Obfuscate character as entity. @@ -264,8 +267,6 @@ inlineToHtml options (Link text (Src src tit)) = else "<a href=\"" ++ (codeStringToHtml src) ++ "\"" ++ (if tit /= "" then " title=\"" ++ title ++ "\">" else ">") ++ (inlineListToHtml options text) ++ "</a>" -inlineToHtml options (Link text (Ref [])) = - "[" ++ (inlineListToHtml options text) ++ "]" inlineToHtml options (Link text (Ref ref)) = "[" ++ (inlineListToHtml options text) ++ "][" ++ (inlineListToHtml options ref) ++ "]" @@ -276,8 +277,6 @@ inlineToHtml options (Image alt (Src source tit)) = "<img src=\"" ++ source ++ "\"" ++ (if tit /= "" then " title=\"" ++ title ++ "\"" else "") ++ (if alternate /= "" then " alt=\"" ++ alternate ++ "\"" else "") ++ ">" -inlineToHtml options (Image alternate (Ref [])) = - "![" ++ (inlineListToHtml options alternate) ++ "]" inlineToHtml options (Image alternate (Ref ref)) = "![" ++ (inlineListToHtml options alternate) ++ "][" ++ (inlineListToHtml options ref) ++ "]" |