All the anchors created by TOC module have extra characters: __ and br__
If the header is: My big great header, the anchor generated is: __my_big_great_headerbr__

Is it normal? Is there any way to customize it?

Thank you in advance

Comments

Anonymous’s picture

Reviewing the HTML, if the code is like:

<h2>
        My big great header
</h2>

This module add spaces and br:

<h2>
        My big great header
        <br />
</h2>

So the anchor generated has the __ and the br on it.

AlexisWilke’s picture

Assigned: Unassigned » AlexisWilke
Category: bug » support

Hi jmesam,

Sorry, I missed answering you on this one sooner. First of all, the _ character should never appear at the beginning. You probably are not using the latest I posted. It may only be in the -dev version at this point. I guess I could add another test to remove double underscore characters and maybe also removing them from the end of the name.

The <br /> is most certainly added by one of the default system filters: Line break converter.

You can avoid the <br /> in the anchors of the table of contents by moving around the filters. The new version of the table of contents will also remove tags thus you can remove the <br /> tag too. I guess, again, that you'd want to test with -dev version.

Thank you.
Alexis Wilke

Anonymous’s picture

Thanks for your answer, I'll try the -dev. Table of content and HTML filter has a weight of 10 and Line break converter a weight of 1. Is it right?

AlexisWilke’s picture

jmesam,

Yes and no. The Line break convertor will be executed before the Table of contents and add the <br /> tags... Yet the newest version will remove those tags from the ID. So it will still work. With the older version, putting the Table of contents before the Line break converter would have at least solved the problem with the _br__ in the ID.

Thank you.
Alexis

Anonymous’s picture

Status: Active » Fixed

The -dev version works as promised. Thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.