[Feature Request] Add option to customize id generation rule
Opened this issue · 2 comments
OpportunityLiu commented
This rule makes all title with no ascii alphabets to have an empty id, which makes it hard to refrence them.
OpportunityLiu commented
In markdown-it-anchor, such option named slugify
.
redbug312 commented
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, '-'))