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

handling dot (.) in heading number scheme #689

Closed
hellt opened this issue May 19, 2020 · 6 comments
Closed

handling dot (.) in heading number scheme #689

hellt opened this issue May 19, 2020 · 6 comments
Labels
Issue: Question Needs Tag fix Does not meet label requirements.

Comments

@hellt
Copy link

hellt commented May 19, 2020

What is the problem?

If the heading has a dot separated number, the link to it is generated incorrectly.

How can I reproduce it?

Create a heading

# 1.1 test heading

Start typing a link in the Markdown body, the dialog with the internal links will suggest 11-test-heading, however, it should be 1-1-test-heading instead.

image

@yzhang-gh
Copy link
Owner

Probably you didn't enable the githubCompatibility option. (Note it will be changed to slugifyMode) in the next release.

@hellt
Copy link
Author

hellt commented May 20, 2020

@yzhang-gh enabling this setting had no effect on this particular behavior =(

@yzhang-gh
Copy link
Owner

yzhang-gh commented May 20, 2020

Alright, I just checked and GitHub/GitLab both generate anchors like 11-test-heading rather than 1-1-test-heading. Which software are you using? Do you confirm 1-1-test-heading really works?

image

@hellt
Copy link
Author

hellt commented May 20, 2020

@yzhang-gh I am using Hugo which uses blackfriday markdown engine afaik

here is an example of the heading https://netdevops.me/2019/creating-a-bootstrap-based-front-end-for-your-simple-rest-service/#1-1-get-your-tool-a-web-interface

@yzhang-gh
Copy link
Owner

Thanks for the information. It looks like Hugo is using Goldmark now (the official docs), from where I have seen a default configuration autoHeadingIDType: github. There is also an option plainIDAnchors: true for blackFriday.

Can you please play around with those configurations and see whether it can be compatible with GitHub?

@hellt
Copy link
Author

hellt commented May 20, 2020

thanks @yzhang-gh !

plainIDAnchors = true

worked

@hellt hellt closed this as completed May 20, 2020
@Lemmingh Lemmingh added the Needs Tag fix Does not meet label requirements. label Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Question Needs Tag fix Does not meet label requirements.
Projects
None yet
Development

No branches or pull requests

3 participants