-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Heading links improvement #492
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
Heading links improvement #492
Conversation
c2bff07 to
0a3757e
Compare
0a3757e to
10c4207
Compare
|
@SleepWalker Hi. If we go with this, you will need to rebase since |
10c4207 to
c2f2409
Compare
|
@JoelMarcey pushed changes without touching CHANGELOG |
c2f2409 to
ef6c160
Compare
|
The unicode handling looks good to me. Great work! For the unique slugs part, not sure how it's meant to work, but currently this: results in I guess that's a negligible edge case. More importantly though, we'll have to find a way to reuse this in the new on-page nav. My suggestion is you separate this into two PRs: one for the unicode changes that can land immediately, and another to make slugs unique that will also take into consideration the on-page nav. |
ef6c160 to
dbfbe05
Compare
Oh, thank you. I have missed that case. The correct ids should be the following: I have removed commit with headings uniqueness logic from current branch and will submit it as a separate PR including support for on-page nav. |
JoelMarcey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great @SleepWalker. Thanks!
Thank you @microbouji for your review.
Motivation
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
I've wrote some test, that should be enough on my opinion.
To check the fixes manually you need write the doc file with the following lines:
By rendering on master branch you will get following anchor links:
After this PR applied:
Things to discuss
Old character mapping in toSlug()
I have found the following filtering rule in
lib/core/toSlug.js:This code does not cover all possible characters, so I think it can be removed. But if we do so, it may be considered as breaking change, right? As for now I left it as is.