TOC block: Adding/updating an Hx breaks all old on-page links
We use the TOC block on every post on michaelkummer.com but noticed that whenever we update an article by changing/adding or updating a heading (Hx), the TOC changes all anchor texts within the TOC, thus breaking any jump links we had previously added.
Is there a way to prevent the plugin from rewriting the anchor (#) texts of the TOC elements when headings in the post are changed?
The anchors are usually auto generated.
Did you add custom anchors for the headings?
And those custom anchors are getting overwritten?
Please let me know.
No, we haven’t used custom anchor headings. Are you suggesting that if we updated the anchor texts in the TOC to a custom text, we shouldn’t have that issue?
In that case, I don’t understand how your anchors are changing.
Can you please share a link to one such page where this happens?