Text Transformations Screencast
A month ago I asked for suggestions for an Obfuscate Selection feature in the HTML bundle. This was prompted by the desire of providing an easy out-of-the-box way for people to quickly obfuscate an email address when writing HTML.
At the same time I also posted two email addresses, one in the clear, and another one being entity-encoded (both wrapped in a mailto:
-link). The plain text email address has since received 286 emails (not surprisingly) and the entity-encoded one received 1 email. So entity-encoding your email address is (presently) effective.
The solution I chose to include with TextMate does however involve JavaScript (source). There was a lot of good suggestions, a popular one being Enkoder. My goal was however to keep the generated JavaScript to an absolute minimum, and offer a simple way to de-obfuscate the code (incase you later want to edit the obfuscated code).
I have chosen to ROT 13 encode the text and have a JavaScript decode and print the string. Decoding ROT 13 is trivial, and this approach seems to be the one which requires the least amount of JavaScript code.
I took the opportunity to record a screencast demoing the feature. In the process I managed to demonstrate half a dozen other features, so it should be interesting even if you do not need this obfuscation command.
The screencast is recorded with r1292 of TextMate which is the first release which bundles the new HTML (email) obfuscation command. I accidentally said “control” instead of “command” for a few key strokes, but I show the key equivalents in the menu, so hopefully there should be no confusion.
This is the first screencast which is optimized for “fast play” meaning you can view it as it is being downloaded. For some reason this was not the default for me when I exported from QuickTime. This is also the first time I put a blog post in the Screencast category (thanks to Brett Terpstra’s category command for the blogging bundle :) ) — he is also to thank for the Wikipedia link (to ROT 13) which comes with a nice title so you can hover the link to learn where it is going. Something I have yet to integrate into one of the default bundles. See the Search and Hyperlink Screencast for what this is about.