Posted by dogbertdp on October 14, 2009 at 6:10pm
Jump to:
| Project: | HTML Purifier |
| Version: | 6.x-2.1 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (works as designed) |
Issue Summary
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
#1
Try upgrading your HTML Purifier version. With Attr.EnableId set to on, a name="" attribute get preserved for me.
#2
I have the same problem. "EnableId" is set to on, I added "name" to "AllowedAttributes". Both config options were made through the GUI.
#3
I 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?
#4
My 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.
#5
Ezyang, 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.#6
I'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??
#7
Numerical IDs are not permitted by the W3C spec. You should enable %HTML.Attr.Name.UseCDATA
#8
"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
#9
There 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
#10
Thanks a lot for the fix.
I just enabled 'EnableID' and the name attribute does not get stripped out. Sweet!