Steps to recreate:

Create anything (block, node) using spamspanned input format. Make sure to include this text: <a href="mailto:test@example.org" class="random" id="test">Email test</a>

Now when you watch it rendered with javascript on — all attributes except href are gone, including id and class.

The generated HTML (after filter and JavaScript) looks like this: <a class="spamspan" href="mailto:test@example.org">Email test</a>

Can spamspan preserve these attributes?

CommentFileSizeAuthor
#6 spamspan-fix_lost_attrs-1012088-6.patch5.19 KBvitalie
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pawel.traczynski’s picture

Yes, this is indeed very very annoying. I discovered this today and for some projects it makes this module totally unusable.

So +1 for this.

peterx’s picture

Issue summary: View changes

Has anyone worked on the Javascript?

You need some code at the start to extract id, style, etc.

I am using the D7 version and it contains the following code to build the link. You could include id, style, etc using .attr.

		$("<a></a>")
		.attr("href", decodeURIComponent(_mailto))
		.html(_anchorText ? _anchorText : _mail)
		.addClass("spamspan")
peterx’s picture

Version: 6.x-1.6 » 7.x-1.1-beta6

I am moving this to D7 for possible work. Someone with D6 will have to port the change back to D6 and test.

peterx’s picture

I am finishing work on the project using Spamspan and will not be able to work on this issue. Can anyone else work on it?

vitalie’s picture

Assigned: Unassigned » vitalie
vitalie’s picture

Version: 7.x-1.1-beta6 » 7.x-1.2
Status: Active » Needs review
FileSize
5.19 KB

Please review this patch.

  • vitalie committed 23f74a1 on 8.x-1.x
    ported patches for issues #1422462, #1167084, and #1012088
    

  • vitalie committed 5dd4976 on 7.x-1.x
    Issue #1012088 by vitalie: Attributes of spam filtered <a>-tags...
vitalie’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Needs review » Closed (fixed)