If a header is called, for example, Tips & Tricks, the table of content section would slugify that as Tips-amp-tricks whereas the actual hash from the header is tips-tricks
This is more problematic than a mismatching anchor. Docusaurus uses scrollSpy, which fails to find the anchor like so:

This exception then blocks lots of other functionalities on the page (e.g. code tab switching)
Yeah
(Write your steps here:)
# Tips & TricksThe problem comes from these lines:
https://github.com/facebook/docusaurus/blob/6670c53d1838750de66ea2e6876da90d906428cb/packages/docusaurus-1.x/lib/core/toc.js#L40
https://github.com/facebook/docusaurus/blob/6670c53d1838750de66ea2e6876da90d906428cb/packages/docusaurus-1.x/lib/core/anchors.js#L25
If you console.log(rendered) in the first snippet, the sanitization turns Tips & Tricks into Tips & Tricks. Whereas if you console.log(textToken.content) in the latter snippet, it's still Tips & Tricks.
cc @JoelMarcey
@chenglou Your website is still on v1 of Docusaurus, right?
cc @yangshun
Yes this is v1.
@chenglou @yangshun This issue was fixed with https://github.com/facebook/docusaurus/pull/2019
Hmm @chenglou are you using the latest Docusaurus v1?