QDoc: Consolidate signature span rendering into InjaBridge callback
Signature span rendering — the role-based conditional chain that
converts structured SignatureSpan IR data into semantic HTML — was
duplicated verbatim across six sites in four template files. Each copy
was a ~500-character single-line Inja conditional handling extra, type,
name, parameter, external-ref, and template-decl roles identically.
Adding new page type templates would propagate the duplication further.
The rendering logic now lives in a render_signature_spans() callback
registered in InjaBridge alongside the existing escape_html() and
escape_md_table() callbacks. Templates call
{{ render_signature_spans(member.signatureSpans) }} with per-site
fallback for entries that lack structured spans. The callback produces
identical HTML output, confirmed by all existing tests passing without
expected output changes.
Link emission for type and name spans uses key presence to match the
original template semantics, where existsIn() checks whether the key
exists regardless of value. Malformed input now degrades gracefully:
non-array signatureSpans emits a qWarning, and non-array children
falls back without throwing.
Also extracts escapeHtml() as a shared static helper used by both the
callback and the escape_html() template function, and reformats switch
case statements to multi-line per Qt coding style.
Fixes: QTBUG-145706
Change-Id: I9ce9e3a1714cec412caee2b5029eae2fb6249cc8
Reviewed-by: David Boddie <david.boddie@qt.io>
Reviewed-by: Topi Reinio <topi.reinio@qt.io>