Skip to content

Use prefix for TableOfContents filter hrefs

Jan Provaznik requested to merge jprovazn-ignore-anchors into master

What does this MR do?

It changes anchor hrefs generated by TableOfContents filter if the href consists only from digits.

Another option would be to ignore links with attribute aria-hidden and class anchor in the AbstractReferenceFilter. But I'm inclined to this solution because it has slightly better performance (no need for extra element check on every render call) and it doesn't rely on presence of specific class/attribute. This should be backward compatible because if fixes only anchors which were not working until now.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

digit-only hrefs are recognized as issue hrefs - see #38473 (closed)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

#38473 (closed)

Edited by Jan Provaznik

Merge request reports