From 9939b0f07ed871d091585b4820b309d087b4cb65 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sat, 28 Jul 2007 02:12:40 +0000 Subject: Make URLs and emails in autolinks appear as Code. git-svn-id: https://pandoc.googlecode.com/svn/trunk@810 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Writers/HTML.hs | 14 +++++++------- src/Text/Pandoc/Writers/LaTeX.hs | 2 +- src/Text/Pandoc/Writers/Markdown.hs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/Text/Pandoc/Writers') diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index c860d73e6..afdfcf9e9 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -140,13 +140,13 @@ obfuscateLink opts text src = (Just [name, domain]) -> let domain' = substitute "." " dot " domain at' = obfuscateChar '@' - linkText = if src' == ("mailto:" ++ text') - then "e" - else "'" ++ text' ++ "'" - altText = if src' == ("mailto:" ++ text') - then name ++ " at " ++ domain' - else text' ++ " (" ++ name ++ " at " ++ - domain' ++ ")" in + (linkText, altText) = + if "mailto:" `isPrefixOf` src' && + text' == ("" ++ drop 7 src' ++ "") + then ("e", name ++ " at " ++ domain') + else ("'" ++ text' ++ "'", + text' ++ " (" ++ name ++ " at " ++ + domain' ++ ")") in if writerStrictMarkdown opts then -- need to use primHtml or &'s are escaped to & in URL primHtml $ "