toAnchor removed every character except ASCII letters, digits and spaces,
so headings like "Read-Only" got the anchor "readonly", while GitHub and
Docusaurus create "read-only". Keep hyphens, underscores and non-ASCII
letters, and add a -1, -2, ... suffix to duplicate anchors, the same way
github-slugger does.