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

[Feature Request] Add option to customize id generation rule #33

Open
OpportunityLiu opened this issue Sep 25, 2020 · 2 comments
Open

Comments

@OpportunityLiu
Copy link

https://github.com/RedBug312/markdown-it-multimd-table/blob/2570107cbf7c595057156cece284f1c8e468d40b/index.js#L61

This rule makes all title with no ascii alphabets to have an empty id, which makes it hard to refrence them.

For example
图片

@OpportunityLiu
Copy link
Author

In markdown-it-anchor, such option named slugify.

@redbug312
Copy link
Owner

redbug312 commented Oct 7, 2020

Thanks for the report. I was waiting for upstream updates for consistent slugify implementation.
However it seems the issue still remains open for conflicts and compatibility problems.

Option slugify can be configured now in branch customize-slugify. It'll be released as v4.1.0.
Default one won't be replaced until v5.0.0, into this line in markdown-it-anchor (without incremented counters)
Recommended to assign it to the option, for future compatibility.

const slugify = (s) => encodeURIComponent(String(s).trim().toLowerCase().replace(/\s+/g, '-'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants