Currently, if you create headline with reference, such as:
== Foo<ref>bar</ref> ==
the TOC is displayed as
- Foo[1]
and the section id is
Foo.5B1.5D
This behavior
- creates highly unstable anchors (adding a single reference before such headline will change the anchor no matter that the headline itself hasn't been changed)
- creates unconsistent behavior (it is expected that clicking on the ref will take you to the references section, however, clicking on the ref in TOC takes you to the section, since it is a part of the section link not the ref link)
- lowers down the accessibility / user friendliness of the TOC
Thus generated TOC should ignore the <ref> content.