Add <email> tag to obfuscate emails/strings for better bot protection #2578
Reference in New Issue
Block a user
Delete Branch "obfuscate-email"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #2484
This PR introduces a new tag
<email>that can be used everywhere to obfuscate email addresses. Right now, if you just writeme@example.com, even the dumbest bot that scrapes the website will find it and can spam you (or others).There are numerous techniques that one could use to avoid that. Many meanwhile make use of Javascript and fancy CSS rules, but they have at least one major downside: accessibility for people using screen readers is destroyed.
Therefore, I went with a mixture of decimal and hexadecimal codes. So within the
<email>tag, anabecomesa(hex) while anxbecomesx(dec). Some common characters even are just left as before. From my understanding, this does not affect screen readers but it should make it harder for script kiddie bots to un-scramble it.This is also usable in XSLT templates, most prominently on our team page. Commit
8d9d8d366edemonstrates this, while80d6e6e367shows the same in the simple form for XML files.Furthermore, you can automatically make it a clickable link with
mailto:. Such a tag may look like<email mailto="yes">me@example.com</email>. If you do not provide themailtoattribute or have another value thanyes, no link will be shown.This element could also be used for other things than email addresses, e.g. telephone numbers. However, since this is probably the most common use case, I kept it simple for editors.