-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fix duplicate heading id #1401
Fix duplicate heading id #1401
Conversation
we also need to test for Flet/github-slugger#20 expect(slugger.slug('test 1')).toBe('test-1');
expect(slugger.slug('test')).toBe('test');
expect(slugger.slug('test')).toBe('test-2'); and expect(slugger.slug('foo'), 'foo')
expect(slugger.slug('foo'), 'foo-1')
expect(slugger.slug('foo 1'), 'foo-1-1')
expect(slugger.slug('foo-1'), 'foo-1-2')
expect(slugger.slug('foo'), 'foo-2') |
That's an interesting problem you found. I fixed this PR, thanks 👍 |
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.
Looks great 👍
@davisjam @joshbruce After this PR lands, I can do a new release. Can you take a look? |
Just to make sure I'm up to speed on the header conversation and whatnot. We're adding slugger to fix a defect, which is header duplication. We are still experiencing issues with unicode characters like Japanese and other glyph languages. And we are still progressing toward dropping header ID generation in the future. Yeah? |
@joshbruce This PR fixes non-latin char headings as well as duplicate IDs. In the future we could drop support and rely on |
We're receiving errors for this latest update (
|
Are you overwriting the renderer methods? https://github.com/markedjs/marked/releases/tag/v0.6.0 If so, try passing new Slugger() Thanks! |
We are adding a wrapper on the table renderer so that must be it. Will try restoring the slugger handler. |
It appears that |
Marked version: 0.5.2
Markdown flavor: All
Description
This fixes several bugs involving
headerIds: true
.This adds a new export
marked.Slugger
.I added several more tests to cover duplicates as well as ampersands.
Contributor
Committer
In most cases, this should be a different person than the contributor.