Skip to content

Allow non alphabetic initial in heading anchor#788

Merged
Michael-F-Bryan merged 2 commits into
rust-lang:masterfrom
weihanglo:feat/non-ascii-heading-anchor
Oct 23, 2018
Merged

Allow non alphabetic initial in heading anchor#788
Michael-F-Bryan merged 2 commits into
rust-lang:masterfrom
weihanglo:feat/non-ascii-heading-anchor

Conversation

@weihanglo
Copy link
Copy Markdown
Member

@weihanglo weihanglo commented Sep 9, 2018

In HTML5 standard, there is no restriction on what forms an ID attribute. The only reason to append a alphabet in the front of original characters is for compatibility.

As far as I know, some popular content generating services, including GitHub, GitBook and GitLab, accept a heading with non-alphabetic initial as a valid ID attribute. Maybe we can conform with the standards without appending an unexpected arbitrary character on ID. This feature will make writing much more ergonomic for non-English users.

Reference: https://www.w3.org/TR/html52/dom.html#element-attrdef-global-id

@Michael-F-Bryan
Copy link
Copy Markdown
Contributor

This seems pretty reasonable, I think we were just being conservative during the initial implementation.

@Michael-F-Bryan Michael-F-Bryan merged commit b0513ee into rust-lang:master Oct 23, 2018
@weihanglo weihanglo deleted the feat/non-ascii-heading-anchor branch October 23, 2018 12:00
Ruin0x11 pushed a commit to Ruin0x11/mdBook that referenced this pull request Aug 30, 2020
…g-anchor

Allow non alphabetic initial in heading anchor
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

Successfully merging this pull request may close these issues.

2 participants