Skip to content

Allow Special characters in HTML ids (anchor links)

Compare
Choose a tag to compare
@dblanchette dblanchette released this 30 Nov 14:42
· 55 commits to main since this release

With this release, nearly all characters are allowed to be used in anchor links.

This should be fine in all modern browsers as it is allowed in the HTML5 specification.

Now links to property in non-ASCII script will be a lot more readable. For example, http://www.example.com/schema.html#名前 instead of http://www.example.com/schema.html#a__. Collisions are also way less frequent.

See #178 for all details.

Revert to the old behavior

If you prefer to stick with the old anchor links (to keep your existing links working or for use in very old browsers), you can do so by setting the config parameter old_anchor_links to true.

Forbidden characters

  • All whitespaces are replaced by _
  • ", ', \, #, ?, and & are removed without a replacement