Skip to content

Instantly share code, notes, and snippets.

@tonejito
Last active February 9, 2022 05:22
Show Gist options
  • Save tonejito/e429dd0efaf4d251d43e6d0d929a6de1 to your computer and use it in GitHub Desktop.
Save tonejito/e429dd0efaf4d251d43e6d0d929a6de1 to your computer and use it in GitHub Desktop.
Obfuscate email address with @jgm pandoc and HTML5
#!/bin/bash
# none, javascript, references
OBFUSCATION=references
echo '<[email protected]>' | pandoc --email-obfuscation ${OBFUSCATION} -f Markdown -t html5
@tonejito
Copy link
Author

$ ./obfuscate-email-address
<p><script type="text/javascript">
<!--
h='&#x65;&#120;&#x61;&#x6d;&#112;&#108;&#x65;&#46;&#x63;&#x6f;&#x6d;';a='&#64;';n='&#x75;&#x73;&#x65;&#114;';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
// -->
</script><noscript>&#x75;&#x73;&#x65;&#114;&#32;&#x61;&#116;&#32;&#x65;&#120;&#x61;&#x6d;&#112;&#108;&#x65;&#32;&#100;&#x6f;&#116;&#32;&#x63;&#x6f;&#x6d;</noscript></p>

@tonejito
Copy link
Author

tonejito commented Feb 9, 2022

$ ./obfuscate-email-address
<p><a href="&#x6d;&#x61;&#x69;&#108;&#116;&#x6f;&#58;&#x75;&#x73;&#x65;&#114;&#64;&#x65;&#120;&#x61;&#x6d;&#112;&#108;&#x65;&#46;&#x63;&#x6f;&#x6d;" class="email">&#x75;&#x73;&#x65;&#114;&#64;&#x65;&#120;&#x61;&#x6d;&#112;&#108;&#x65;&#46;&#x63;&#x6f;&#x6d;</a></p>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment