Preserving HTML header attributes is causing side-effects.
stacysimpson - August 7, 2009 - 13:27
| Project: | Table of Contents |
| Version: | 6.x-3.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
I have some header tags that incorporate href tag to link to the detailed version of the content. When the new TOC stuff runs, the HTML attributes are being preserved, so the TOC links do not appropriate index within the current URL.
The TOC is pointing to the inner most href:
Shouldn't all href attributes be filtered out.?.? If not, can you give me some insight for where to incorporate this type of filtering locally.

#1
Whoops, here is the HTML again:
<li class="toc-level-1"><a href="#HelloTitle"><a href="/drupal6/content/hellotitle" title="HelloTitle">HelloTitle</a></a></li>#2
OK, I integrated PHP's 'strip_tags()' function in two places in the attached patch. I'm not sure if anyone would want this filtering to be configurable or not.
#3
Stacy,
I'm thinking that a strip_tags() by itself may be a bit too drastic. Should we allow all tags except <a> tags?
That means if you have elements such as <em> and <strong> they would stay. We could also allow the user to enter the list of tags he/she wants to keep.
Thank you for the patch!
Alexis Wilke
#4
'' tags was definitely the issue for us. I could foresee something like the 'WYSIWYG Filter' which allows people to specify certain tags as allowable. Not sure it's worth the effort though.?.?
#5
Stacy,
You have to be careful no Drupal and write < when you want to include a < character. 8-)
No time this week, but since you already have working solution for your site I suppose you can wait some time to get an official version.
Thank you.
Alexis