QDoc: Consolidate content-block dispatch into a shared partial
The block-type rendering decisions for HTML and Markdown body
output had to be kept in sync across multiple paths: the
top-level content path, the section-children path inside that
content, the catalog-inlined path, and the equivalent surfaces
in class member documentation. Adding a new block type meant
editing four to six paths in lockstep; a missed update on any
path silently emitted a plain-text fallback in place of the
expected rendering, with no compiler help to flag the gap. Each
copy had also drifted in its application of recent fixes — HTML
attribute escaping, alternating row classes, Markdown table cell
spacing, compact-list newline preservation — so the same block
type rendered differently depending on which surface it appeared
on.
The dispatch decisions now live in one shared partial per
format, invoked through a single include from every
body-rendering path. The section branch stays in the caller
because the template engine resolves includes at parse time and
a partial that includes itself triggers parser recursion; the
caller iterates section children and includes the partial per
child instead.
Class member documentation inherits the unified dispatch as
well, which gives member tables the alternating row classes and
attribute escaping the page body already has, and gives
section-nested definition lists the value-list table form they
previously lacked. Two validation fixtures regenerate with
slightly tighter whitespace because the consolidated path no
longer pays the surrounding-blank-line cost the duplicated paths
each carried.
escape_html() now accepts non-string JSON values so shared
templates can escape generated numeric attributes without
type-specific branches.
Fixes: QTBUG-146615
Change-Id: I7f36891846fdc5ffe52e7da715b7ce8e5bd03f1a
Reviewed-by: Topi Reinio <topi.reinio@qt.io>