aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-12-30 22:51:49 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-12-30 22:51:49 +0000
commit4ea1b2bdc0a86f135bae4ae95cfc3d45a9416604 (patch)
tree55cbdff00c136a483f5a280c07930635d58c9e3b /src/Text/Pandoc/Writers/HTML.hs
parent7cd9db048b9c29238efd1cecda65264db4223dcd (diff)
downloadpandoc-4ea1b2bdc0a86f135bae4ae95cfc3d45a9416604.tar.gz
Merged 'strict' branch from r324. This adds a '--strict'
option to pandoc, which forces it to stay as close as possible to official Markdown syntax. git-svn-id: https://pandoc.googlecode.com/svn/trunk@347 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs19
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) ++ "]"