Any chance this can be modified to output clickable anchor text instead of the full email address? I would be willing to sponsor such an update.

Cheers,
Alex

CommentFileSizeAuthor
#1 spamspan.patch5.73 KBfokkezb

Comments

fokkezb’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new5.73 KB

I wanted the same, so I made this patch:

Note: This includes changes I made to port to 6.x, earlier posted as #235709: Patch to port to 6.x

Changes:

  • Fixed typo in spamspan.js:
    // Old (. missing) var _anchorText = $("span" +  Drupal.settings.spamspan.t, this).text();
    var _anchorText = $("span." +  Drupal.settings.spamspan.t, this).text();
  • Moved output of spamspan tags to theme method.
  • Added pattern for replacing hyperlinks with spamspan tags, respecting anchor texts.

Lakka, please port to 6.x and implement this feature asap.

lakka’s picture

Sorry, I don't quite understand what you are trying to achieve here. Can you give me an example? Suppose I type joe.bloggs@example.com into an edit box. How do you want it to render on screen, and in the html source?

fokkezb’s picture

I want present hyperlinks (done by some WYSIWYG editor) like:

<a href="mailto:me@example.com">mail me</a>

to render as:

<span class="spamspan">
  <span class="u">me</span> [at] <span class="d">example [dot] com</span> (<span class="t">mail me</span>)
</span>

just as SpamSpan example #1:

http://www.spamspan.com/#examples

lakka’s picture

Status: Patch (to be ported) » Needs work

Thanks, I understand now. I am happy to commit a patch, but please can you recreate it against version 5.x-1.3, or version 6.x-1.0. The version you have currently patched is rather different to the more current versions.

lakka’s picture

Status: Needs work » Closed (duplicate)

Marking as duplicate of http://drupal.org/node/168301

Preliminary fix is in cvs on the Drupal 6 branch