diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 36ce2ba21..9ead604d7 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -40,7 +40,7 @@ import Text.Pandoc.Slides import Text.Pandoc.Highlighting ( highlight, styleToCss, formatHtmlInline, formatHtmlBlock ) import Text.Pandoc.XML (fromEntities, escapeStringForXML) -import Network.URI ( parseURIReference, URI(..) ) +import Network.URI ( parseURIReference, URI(..), unEscapeString ) import Network.HTTP ( urlEncode ) import Numeric ( showHex ) import Data.Char ( ord, toLower ) @@ -361,13 +361,13 @@ obfuscateLink opts txt s = ReferenceObfuscation -> -- need to use preEscapedString or &'s are escaped to & in URL preEscapedString $ "" ++ (obfuscateString txt) ++ "" + ++ "\" class=\"email\">" ++ (obfuscateString txt) ++ "" JavascriptObfuscation -> (H.script ! A.type_ "text/javascript" $ preEscapedString ("\n\n")) >> H.noscript (preEscapedString $ obfuscateString altText) _ -> error $ "Unknown obfuscation method: " ++ show meth @@ -739,9 +739,12 @@ inlineToHtml opts inline = RevealJsSlides -> '#':'/':xs _ -> s let link = H.a ! A.href (toValue s') $ linkText + let link' = if txt == [Str (unEscapeString s)] + then link ! A.class_ "uri" + else link return $ if null tit - then link - else link ! A.title (toValue tit) + then link' + else link' ! A.title (toValue tit) (Image txt (s,tit)) | treatAsImage s -> do let alternate' = stringify txt let attributes = [A.src $ toValue s] ++ diff --git a/tests/writer.html b/tests/writer.html index bbe835720..8b0877f33 100644 --- a/tests/writer.html +++ b/tests/writer.html @@ -480,7 +480,7 @@ Blah
@@ -503,20 +503,20 @@ document.write(''+'Email link'+'<\/'+'a'+'>')Here’s an inline link.
Here’s an inline link in pointy braces.
With an ampersand: http://example.com/?foo=1&bar=2
+With an ampersand: http://example.com/?foo=1&bar=2
An e-mail address:
-Blockquoted: http://example.com/
+Blockquoted: http://example.com/
Auto-links should not occur here: <http://example.com/>
or here: <http://example.com/>