Closed (works as designed)
Project:
HTML Purifier
Version:
6.x-2.1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2009 at 18:10 UTC
Updated:
30 Jun 2011 at 11:03 UTC
Has anyone gotten fckeditor 2.6 anchors to work with HTML Purifier? I have set EnableID to "Yes".
If I create an anchor using the anchor button, fckeditor creates markup similar to the following:
<a name="testanchor"></a>
which HTML Purifier filters to:
<a></a>
If I go into source and change <a name= to <a id=, the anchor works, but my users won't know to do that (also fckeditor strips that change out if you edit the node).
Has anyone figured out how to either get HTML Purifier to accept "name" or fckeditor to use the "id" attribute instead of "name"?
Thanks,
Mike Hays
Comments
Comment #1
ezyang commentedTry upgrading your HTML Purifier version. With Attr.EnableId set to on, a name="" attribute get preserved for me.
Comment #2
kiluminati commentedI have the same problem. "EnableId" is set to on, I added "name" to "AllowedAttributes". Both config options were made through the GUI.
Comment #3
promesI tried to change my setting for version 5-1.4, but I can't find the correct settings.
I did set the following GUI options:
Enable allowed specification: set
Allowed specification: name (this was added)
I tried both set and unset of: Allow the ID attribute in HTML
Can anyone help me out?
Comment #4
ezyang commentedMy apologies for the extremely late response.
Remove the allowed name specifications (i.e. don't click the checkbox), and ONLY set "Allow the ID attribute in HTML" to be checked, and it should work. This is only for the Drupal 5 version of the module.
Comment #5
promesEzyang, thanks for the update. It works fine. BUT you have to empty the database table cache_htmlpurifier as well or update all nodes with a link to a
<a name=...>I presume.Comment #6
kruser commentedI'm seeing this issue in the drupal 6 version. I set "EnableID" to Yes, and cleared cache, but it's still removing the name attribute from an anchor tag.
edit: My anchor names are "1", "2", "3" etc., but if I switch them to a, b, c, etc - then i works. Why won't numerical names work??
Comment #7
ezyang commentedNumerical IDs are not permitted by the W3C spec. You should enable %HTML.Attr.Name.UseCDATA
Comment #8
Angelbaby commented"Remove the allowed name specifications (i.e. don't click the checkbox), and ONLY set "Allow the ID attribute in HTML" to be checked, and it should work. This is only for the Drupal 5 version of the module."
In lamers terms, how do you set "allow the id attribute in HTML" to be checked? Not quiet clear on this point. Im finding that the html purifier is stripping name attributions from my code in drupal 6...
Any help would be great please
Comment #9
ezyang commentedThere is a filter configuration page that has these configuration options. On new version of the module, set Attr.EnableId, or if FCKEditor is producing bogus name values, use HTML.Attr.Name.UseCDATA
Comment #10
anthonyR commentedThanks a lot for the fix.
I just enabled 'EnableID' and the name attribute does not get stripped out. Sweet!