Instead of generating a useless before the relevant
<h?> tag, just add the id attr to the <h?> tag if it does not have
one already.
This way, the target of the link is exactly the <h?> tag, and the
browser positions the focus exactly on it. Without this, there was a
slight difference in offset between tags which had an id= attr an
tags which didn't.
I didn't follow the development, but apparently the new version doesn't have the drawback I fixed with this PR, so I guess we can just close without merging.
Instead of generating a useless before the relevant <h?> tag, just add the id attr to the <h?> tag if it does not have one already.
This way, the target of the link is exactly the <h?> tag, and the browser positions the focus exactly on it. Without this, there was a slight difference in offset between tags which had an id= attr an tags which didn't.