Closed yannickseurin closed 11 months ago
Indeed this seems broken and should be fixed.
I wonder though do I need to enable anything or add another plugin to get proper rendering for $q_1
? It doesn't seem to render math out of the box
Hm, no wait. We do the right thing! In a local test I get this generated in the ToC:
<li><a href="#analysis-of-q_1">Analysis of $q_1$</a></li>
With mdbook generating:
<h1 id="analysis-of-q_1"><a class="header" href="#analysis-of-q_1">Analysis of $q_1$</a></h1>
So ... we're fine actually? Please show me a reproducable example.
Ah forgot to mention I'm using mdbook-katex to render math... I can confirm that when not using it everything works fine as you described. The problem shows up when using both mdbook-katex and mdbook-toc as mdbook now generates
<h1 id="analysis-of-q1"><a class="header" href="#analysis-of-q1">...</a></h1>
So I guess it's rather an issue with mdbook-katex
We do essentially the same that mdbook does. If katex modifies the code after that it of course will break.
Closing this as not an issue with mdbook-toc though.
Links are not properly formatted when using underscores in math mode, e.g.
## Analysis of $q_1$
produces anchor
#analysis-of-q1
for the header but the link in the toc isanalysis-of-q_1