Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table of contents link does not work when headers contain special characters #36

Closed
rosshug opened this issue Jun 5, 2020 · 1 comment · Fixed by #40
Closed

Table of contents link does not work when headers contain special characters #36

rosshug opened this issue Jun 5, 2020 · 1 comment · Fixed by #40
Labels
bug Something isn't working

Comments

@rosshug
Copy link

rosshug commented Jun 5, 2020

Headers in markdown have an anchor which is used for links, format is '#' then the header text converted to lower-case, spaces replaced with hyphens, and special characters removed.

The Table of Contents in MdUtils has a link to the header by converting to lower-case and replacing spaces with hyphens, but does not remove special characters. This means that some of the links in the ToC will not work.

For example I have a header level 2, with text "Unnamed: 41", when I create a ToC the link to this is #unnamed:-41, but should be #unnamed-41, i.e. without the colon. Clicking on the link does not take me to the header section of the document as it should do..

@rosshug rosshug added the bug Something isn't working label Jun 5, 2020
@didix21
Copy link
Owner

didix21 commented Jun 5, 2020

Thanks for reporting the bug I will take a look as soon as I can.

@didix21 didix21 linked a pull request Jun 21, 2020 that will close this issue
didix21 added a commit that referenced this issue Jun 21, 2020
…t-work-

Fix #36: Delete special characters when creating toc links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants