Table of contents - Custom filter
Hi , most of the logic for the table of contents component is handled at TableOfContentsFilter.java. I see the component creates IDs for h1-h6 elements in a page if not already present and then maps it to the table of contents list items. In this process, all the unnecessary text elements within the h1-h6 tags such as <span> classes are also getting copied to the id field and the same id displayed on the Table of contents list as well without any formatting. (For example superscripted references)
Now, I am looking at modifying this logic in the filter class and I would like to know if that's possible. A model delegate is not possible here and the logic is heavily built in the filter. Can we extend or by any means modify the logic here with no much hassle.
Thanks for your time and highly appreciate any suggestions.