Skip to content

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

Description

@OpportunityLiu

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
图片

Activity

  1. OpportunityLiu commented on Sep 25, 2020

    @OpportunityLiu
    Author

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

  2. redbug312 commented on Oct 7, 2020

    @redbug312
    Owner

    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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions