Closed (fixed)
Project:
Table of Contents
Version:
6.x-3.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Aug 2009 at 13:27 UTC
Updated:
12 May 2010 at 23:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
stacysimpson commentedWhoops, here is the HTML again:
Comment #2
stacysimpson commentedOK, 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.
Comment #3
AlexisWilke commentedStacy,
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
Comment #4
stacysimpson commented'' 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.?.?
Comment #5
AlexisWilke commentedStacy,
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
Comment #6
zoo commentedHello,
me too having the same problem experienced by Stacy, some headers in the page contain href links which remain in TOC output, this causing items to be unusable.
Do you have any news by chance? Thank you
zoo
Comment #7
AlexisWilke commentedzoo,
There is actually a fix for that problem in the -dev version. It includes code to remove any anchor from the title in the TOC itself. Are you using version 3.1?
Thank you.
Alexis
Comment #8
zoo commentedHello AlexisWilke,
Yes, I am using the 3.1.
I had solved by hacking the core module with the "tableofcontents.pages_.inc_.diff" (Stacy, above).
But now I will try the dev version of the module you suggested. Thank You!
zoo
Comment #9
AlexisWilke commentedLet me know if the -dev worked for you. If so, I could do a 3.2 and close this issue.
Thank you.
Alexis
Comment #10
stacysimpson commentedWell, I finally got a chance to review these changes and the 6.x-3.5 version does indeed filter out the HTML control characters. Basically, it is now functional, but leaves a very ugly id / anchor: All of the tokens, including 'a', 'href', and "the referred url" are left in the id, so the resulting URL+anchor is huge. We would prefer to see the anchor generated from the title information that is actually displayed to user's.
Also, we are having problems with the following characters in anchors:
- numeric characters
- periods characters
- underscore characters at the beginning of anchors
So, I re-rolled our patch for 3.5.
Comment #11
AlexisWilke commentedHi Stacy,
As mentioned in my earlier post, we probably want to keep some of the tags. Maybe not you, but some other people probably would want to. So I added an option to let you define which tags are kept (the list can be empty) and also which characters to remove from the identifiers. In regard to the identifiers, there was actually a bug since an identifier cannot start but with a letter ([A-Za-z]). So I fixed that part too! (it was partially done in your fix.)
This is in the CVS, and will appear as the -dev within 12h. It will be part of 3.6.
Thank you.
Alexis
P.S. Feel free to reopen the bug if you still have problems after you defined the settings in your formats.