Skip to content

Instantly share code, notes, and snippets.

@mreq
Created July 12, 2014 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mreq/9f77e69eb4e894c54e15 to your computer and use it in GitHub Desktop.
Save mreq/9f77e69eb4e894c54e15 to your computer and use it in GitHub Desktop.
Protect emails
$ ->
$('.em').filter('[data-em]').each ->
t = $(this)
e = t.data('em').replace '/', '@'
t.attr('href', 'mailto:'+e).not('.custom-text').text e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment