git.iko.soy/typeable/pandoc
on master help sign in
Fixed email javascript obfuscation with mailto: URLs.
9e528f4John MacFarlane
src/Text/Pandoc/Writers/HTML.hs+2−2
@@ -375,8 +375,8 @@ obfuscateLink opts (renderHtml -> txt) s =
375 (linkText, altText) =
375 (linkText, altText) =
376 if txt == drop 7 s' -- autolink
376 if txt == drop 7 s' -- autolink
377 then ("e", name' ++ " at " ++ domain')
377 then ("e", name' ++ " at " ++ domain')
378− else ("'" ++ txt ++ "'", txt ++ " (" ++ name' ++ " at " ++
378+ else ("'" ++ obfuscateString txt ++ "'",
379− domain' ++ ")")
379+ txt ++ " (" ++ name' ++ " at " ++ domain' ++ ")")
380 in case meth of
380 in case meth of
381 ReferenceObfuscation ->
381 ReferenceObfuscation ->
382 -- need to use preEscapedString or &'s are escaped to & in URL
382 -- need to use preEscapedString or &'s are escaped to & in URL
tests/writer.html+1−1
@@ -481,7 +481,7 @@ Blah
481<p><script type="text/javascript">
481<p><script type="text/javascript">
482<!--
482<!--
483h='&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#46;&#110;&#x65;&#116;';a='&#64;';n='&#110;&#x6f;&#98;&#x6f;&#100;&#x79;';e=n+a+h;
483h='&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#46;&#110;&#x65;&#116;';a='&#64;';n='&#110;&#x6f;&#98;&#x6f;&#100;&#x79;';e=n+a+h;
484−document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+'Email link'+'<\/'+'a'+'>');
484+document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+'&#x45;&#x6d;&#x61;&#x69;&#108;&#32;&#108;&#x69;&#110;&#x6b;'+'<\/'+'a'+'>');
485// -->
485// -->
486</script><noscript>&#x45;&#x6d;&#x61;&#x69;&#108;&#32;&#108;&#x69;&#110;&#x6b;&#32;&#40;&#110;&#x6f;&#98;&#x6f;&#100;&#x79;&#32;&#x61;&#116;&#32;&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#32;&#100;&#x6f;&#116;&#32;&#110;&#x65;&#116;&#x29;</noscript></p>
486</script><noscript>&#x45;&#x6d;&#x61;&#x69;&#108;&#32;&#108;&#x69;&#110;&#x6b;&#32;&#40;&#110;&#x6f;&#98;&#x6f;&#100;&#x79;&#32;&#x61;&#116;&#32;&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#32;&#100;&#x6f;&#116;&#32;&#110;&#x65;&#116;&#x29;</noscript></p>
487<p><a href="">Empty</a>.</p>
487<p><a href="">Empty</a>.</p>