QDoc: Render signature spans and strip CodeMarker tags
The signature span data is built and serialized to JSON, but the
HTML templates still render plain signature strings. Meanwhile,
CodeMarker produces tagged strings for syntax highlighting that the
legacy generators strip via plainCode(), but ContentBuilder passes
through unmodified, causing markup to leak into template output.
HTML templates now iterate signatureSpans with role-based rendering:
type names get CSS-classed spans with optional hyperlinks, parameter
names are italicized, extra qualifiers render as badges with nested
external reference links, and template declarations show nested
type parameters. Templates fall back to the plain signature string
when signatureSpans is absent. Markdown templates use the signature
string directly, as structured rendering isn't meaningful in plain
text.
ContentBuilder strips CodeMarker tags at the IR boundary for inline
code from the \c command and code blocks from \code, \badcode, and
\qml commands, mirroring what Generator::plainCode() does for the
legacy generators.
Fixes: QTBUG-145121
Change-Id: I862551700292f5665db07f8c5dfc0fa73c4f6c42
Reviewed-by: David Boddie <david.boddie@qt.io>
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
| commit | 607986b8629b6957a4a6354f7eaf69560a4258af |
| parent | 2cab1214492b0eb3fe5c33a4972f3367059afa58 |
| author | Paul Wicking <paul.wicking@qt.io> |
| committer | Paul Wicking <paul.wicking@qt.io> |
| commit time | Wed, 8 Apr 2026 10:15:57 +0100 |
- M src/qdoc/qdoc/src/qdoc/ir/contentbuilder.cpp
- M src/qdoc/qdoc/src/qdoc/templates/members.html
- M src/qdoc/qdoc/src/qdoc/templates/page.html
- M src/qdoc/qdoc/src/qdoc/templates/partials/html/member_detail.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/html_escaping/expected/template/html-escaping.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/lottietoqml.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qml-qt-labs-lottieqt-lottieanimation-members.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qml-qt-labs-lottieqt-lottieanimation.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qml-qt-labs-lottieqt-vectorimagehelpers-layeritem-members.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qml-qt-labs-lottieqt-vectorimagehelpers-layeritem.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qt-labs-lottieqt-qmlmodule.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qt-labs-lottieqt-vectorimagehelpers-qmlmodule.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qt-target-qml-from-lottie.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qtlottieanimation-index.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/lottietoqml.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qml-qt-labs-lottieqt-lottieanimation.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qt-labs-lottieqt-qmlmodule.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qt-labs-lottieqt-vectorimagehelpers-qmlmodule.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qt-target-qml-from-lottie.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qtlottieanimation-index.md