Strip TOC headings of links and styling

Use case or problem

I use links in my headings and sometimes also styling (italics) or code. Currently, the TOC is made up of the raw text from the headings which doesn’t look pretty.

Proposed solution

The TOC shouldn’t be parsed like the heading in the file itself, the headings in the TOC should be stripped of all (external and internal) links and also styling.
I don’t have an idea for codeblocks yet, perhaps they should also be stripped of the `` because I think it wouldn’t look good in the TOC.

6 Likes

I agree with the removal of brackets due to links.
But, I would like to be able to keep the code for styling purpose: I am using icons in my titles, or at least wanted to.
Would be nice if could actually render the expected icon in the TOC