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

Headline shortcut in ID with underline when headline starts with a number #1516

Open
sanjaay opened this issue Feb 18, 2021 · 1 comment
Open

Comments

@sanjaay
Copy link

sanjaay commented Feb 18, 2021

Bug Report

Steps to reproduce

  1. Create a headline in your docsify project
    example ## 1. my headline
  2. check the parameter of the id

The URL is: URL?id=_1-my-headline
Should be: URL?id=1-my-headline

What is current behaviour

The id is: URL?_id=_1-my-headline

What is the expected behaviour

The id should be : URL?id=1-my-headline

There should be no underline before at the beginning.

@Koooooo-7
Copy link
Member

Koooooo-7 commented Feb 18, 2021

Thx for ur report.
It is the way how we solve the siderbar links rn.
According to the W3C docs id-selectors.

An ID selector consists of a “number sign” (U+0023, #) immediately followed by the ID value, which must be a CSS identifier.

When a head starts with digit, it is not a valid selector , so we add the _ to make it works as anchor on sidebar.

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

No branches or pull requests

2 participants