QDoc: Keep legacy HTML fragment IDs distinct
Class pages can give the same fragment ID to different headings,
targets, or members. Links to that fragment then reach only the first
element, leaving the others inaccessible.
Give colliding elements distinct IDs and keep target indexes and
section links aligned with the emitted anchors. Avoid rendering the
same member twice when a shared comment repeats it.
[ChangeLog][QDoc] HTML pages now use distinct fragment IDs for
colliding headings, targets, and members.
Pick-to: 6.12
Fixes: QTBUG-151300
Change-Id: Iad23da7e28adc741ef96588e9784982410f70218
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
| commit | ca1272cf35070bc46ad29efc9d5c131896604532 |
| parent | caf225a90f08d9624d0a086d28e0b95fb4ae6af2 |
| author | Paul Wicking <paul.wicking@qt.io> |
| committer | Paul Wicking <paul.wicking@qt.io> |
| commit time | Fri, 9 Oct 2026 08:02:58 +0000 |
- M src/qdoc/qdoc/src/qdoc/htmlgenerator.cpp
- M src/qdoc/qdoc/src/qdoc/htmlgenerator.h
- M src/qdoc/qdoc/src/qdoc/qdocindexfiles.cpp
- M src/qdoc/qdoc/src/qdoc/tree.cpp
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/member_section_anchors/expected/html/member-section-anchors.index
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/member_section_anchors/expected/html/membersectionanchors-members.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/member_section_anchors/expected/html/membersectionanchors.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/member_section_anchors/expected/html/membersectionanchorsmodule-module.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/member_section_anchors/member_section_anchors.qdocconf
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/member_section_anchors/src/member_section_anchors.h
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/member_section_anchors/src/member_section_anchors.qdoc
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/navigation/expected/html/subpage.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/navigation/expected/markdown/subpage.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/navigation/expected/testnavigation.index