badboy / mdbook-toc

A preprocessor for mdbook to add inline Table of Contents support.
Mozilla Public License 2.0
163 stars 20 forks source link

Wrong href for unicode id #29

Closed SichangHe closed 1 year ago

SichangHe commented 1 year ago

The specific problem can be observed here.

Please click on the second button on the top-left to see the toc in sidebar. In the sidebar, the anchor that says Bézout's identity actually has an href of #b%C3%A9zouts-identity, but the actual id of the corresponding element in the article is #bézouts-identity.

If you need more information, please let me know.

Thank you. Steven Hé (Sīchàng)

badboy commented 1 year ago

Seems like this plugin does everything right (and it really does just what mdbook does). Your frontend code is wrong and you should use decodeURIComponent.

SichangHe commented 1 year ago

Thank you for your help! According to your suggestion to use decodeURIComponent, I fixed my issue here.