doc: improve fragment (:target) anchors behavior on HTML version
#42739
+43
−12
:target) anchors behavior on HTML version
#42739