From f1eb3b316904a20ccde4b60aa62977ad73e2d6a2 Mon Sep 17 00:00:00 2001 From: Timm Albers Date: Tue, 4 Apr 2017 10:36:00 +0200 Subject: Add original classes to JS obfuscated links (#3554) HTML links containing classes originally now preserve them when using javascript email obfuscation. Fixes #2989 --- src/Text/Pandoc/Writers/HTML.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index ef5e6b416..d56a6e4ae 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -475,6 +475,8 @@ obfuscateLink opts attr (renderHtml -> txt) s = then ("e", name' ++ " at " ++ domain') else ("'" ++ obfuscateString txt ++ "'", txt ++ " (" ++ name' ++ " at " ++ domain' ++ ")") + (_, classNames, _) = attr + classNamesStr = concatMap (' ':) classNames in case meth of ReferenceObfuscation -> -- need to use preEscapedString or &'s are escaped to & in URL @@ -487,7 +489,8 @@ obfuscateLink opts attr (renderHtml -> txt) s = preEscapedString ("\n\n")) >> H.noscript (preEscapedString $ obfuscateString altText) _ -> throwError $ PandocSomeError $ "Unknown obfuscation method: " ++ show meth -- cgit v1.2.3