Not so sure about that.
As far as I know, all the anchors needs to be unique (ids), so there is a possibility that titles are reused (especially for second level titles), then we end up with two similar ids.
We could ‘check for this’, but maybe it is better to include a unique ‘number’
Maybe having too long ids (and urls to share) is not perfect, maybe just the first xx characters?
where x could be ‘count of anchors’, but this would also mean that if you share a link and add another heading, the link is not working anymore.
If that is a problem, we probably have to check somehow
… while we are at this subject, I made a ‘floating menu’ if that should be of interest to anyone (was in fact a bit tricky)… scroll down see it: