QDoc: Preserve image captions in template output
The Template Generators drops image caption. The parser wraps
caption content in its own paragraph, but the IR builder has no
dispatch for the caption atoms, so the content is discarded with
a warning and the rendered output loses it entirely. Documentation
that annotates images with formatted captions, such as the
QEasingCurve value entries, then reads without its explanations.
Map the caption atoms to a paragraph block carrying the `figCaption`
class. This is the same class used by the HTMLGenerator. Templates
render the block with its formatted content after the image in both
HTML and Markdown output, and the image fixture covers captions next
to block images, inside list items, inside table cells, and following
value list entries.
Fixes: QTBUG-151158
Pick-to: 6.12
Change-Id: I5ce6487c7299ffff88c96ef42cad7120fafca99b
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
| commit | cdf60b1fd0ac9a8f0a6473af9229836f0bfd7b7a |
| parent | e3bcc7a924dae41cc2d824551e9d9eb5f24f3741 |
| author | Paul Wicking <paul.wicking@qt.io> |
| committer | Paul Wicking <paul.wicking@qt.io> |
| commit time | Tue, 6 Oct 2026 08:09:38 +0000 |
- M src/qdoc/qdoc/src/qdoc/ir/contentbuilder.cpp
- M src/qdoc/qdoc/src/qdoc/templates/partials/html/content_blocks.html
- M src/qdoc/qdoc/src/qdoc/templates/partials/md/content_blocks.md
- M src/qdoc/qdoc/tests/qdoc/ir/catch_contentbuilder.cpp
- R100 src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/image_rendering/expected/template/images/test-image.png
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/image_rendering/expected/html/page-with-images.html
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/image_rendering/expected/markdown/images/test-image.png
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/image_rendering/expected/markdown/page-with-images.md
- D src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/image_rendering/expected/template/page-with-images.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/image_rendering/image_rendering.qdocconf
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/image_rendering/src/image_rendering.qdoc
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/lottietoqml.md