Snippet List
Put this snippet in a file in a templatetags/ directory and load it in your templates. Then use it to encode your emails:
`{{"[email protected]"|html_encode_email}}`
Or if you want some control over the anchor tag:
`<a href="mailto:{{"[email protected]"|html_encode}}&subject=Feedback">Send Feedback</a>`
From [fahhem.com](http://fahhem.com/) and [Recrec Labs](http://recreclabs.com/)
- templatetag
- email
- spam
- encode
This is a django filter which will create an html mailto link when you use the syntax:
{{ "[email protected]"|encode_mailto:"Name" }}
Results in:
<a href="mailto:[email protected]">Name</a>
Except everything is encoded as html digits.
The encoding is a string of html hex and decimal entities generated randomly.
If you simply want a string encoding use:
{{ "name"|encode_string }}
This was inspired by John Gruber's [Markdown](http://daringfireball.net/projects/markdown/syntax#autolink) project
3 snippets posted so far.