First, thanks for the great plugin to HTML Purifier.

I had this issue where anchor name attributes were stripped out: http://drupal.org/node/276167 .

So I found this: http://htmlpurifier.org/docs/enduser-id.html

And I poked around through HTML Purifier and the module for a while, trying to figure out where to paste this:

$config->set('HTML', 'EnableAttrID', true);

And tried to do it in the get_config method, but to no avail.

Anyhow, I think anchors are kind of dumb, but my client doesn't, so it'd be nice to know how to keep HTML Purifier from stripping them out. Until then, I'll just make another filter for admins that doesn't use HTML Purifier.

If you have time, it'd be nice to know where I would insert the EnableAttrID code (I'm still learning PHP).

Anyhow, thanks much for the module and for your support on past issues.

-glass.dimly

Comments

ezyang’s picture

Each filter you make should have a configuration associated with it, click to that page and there should be an option for you to turn on IDs.

If you need support for a name, check out this patch (for the 2.x series).

glass.dimly’s picture

Status: Active » Closed (fixed)

Thank you.

Yeah, anchor names are still broken after checking the ID tag. Maybe I'll give your patch a whirl. Anyhow, I'm marking the issue closed.

-glass.dimly

bryancasler’s picture

Anyone have any solution for this, it's been driving me nuts and all the leads I have found have been dead ends.

ezyang’s picture

Hi animelion,

Could you open a new support ticket with details about what's not working?

bryancasler’s picture

It turns out my anchor tags were being stripped because I was using an ampersand in them (ie name="Member & Supporter") as well as spaces (ie name="New supporter"). The Typogrify module was wrapping the ampersands with a class and treating the word following the space as a widow, thus placing a non-breaking space before it. So in the end everything is working now.

jordimateubesancon’s picture

jordimateubesancon’s picture

The same happens using numbers in name tags. Just changing for and all works as expected.