Skip to content

Auto-generated anchors with slashes produce malformed URLs with extra dash [v5-rc3] #2638

Description

@paulhibbitts

Description

Automatically generated anchors containing forward slashes (/), which worked correctly in Docsify v4, seem to be malformed in v5-rc3. The auto-generated anchor IDs are adding an extra dash (-) character, causing navigation links to fail.

Expected behavior

  • Auto-generated anchor for 'Data / ML' should be: ?id=data-ml
  • Clicking the link should navigate to the heading
  • This worked correctly in Docsify v4

Actual behavior

  • Auto-generated anchor for 'Data / ML' becomes: ?id=data--ml (note the double dash)
  • Link fails to navigate to the target heading

Working (v4):
https://codesandbox.io/p/sandbox/docsify-v4-pages-with-slashes-dxw67d

Not working as Expected (v5-rc3):
https://codesandbox.io/p/sandbox/summer-haze-zwyh5f

Reference repository:
https://github.com/hanzili/canada_sde_intern_position

Please let me know if any additional info is needed, etc.

Steps to reproduce

  1. Create a heading with a slash in the name: ## Data / ML
  2. Use Docsify's auto-generated table of contents or anchor links
  3. Click on the "Data / ML" link

Environment

No response

Additional Information

  • Bug still occurs when all/other plugins are disabled?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Triagebugconfirmed as a bugv5-rcv5 rc version related

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions