QDoc: Emit valid anchor attributes on section headings
Section headings in the template generator's HTML output carry an
identifier used by in-page links, the sidebar table of contents, and
cross-page deep links. The heading partials rendered this identifier
with a literal space before the attribute name, relying on ordinary
whitespace to separate the tag name from its attribute. Inja's block
trimming collapses whitespace adjacent to control-flow tags, so once
section identifiers started flowing into the templates the rendered
markup would lose the separator and produce an unparseable element
name fused with the attribute. Browsers would ignore the malformed
element, anchors would point to nothing, and table-of-contents entries
would appear to jump into arbitrary paragraph text.
The space separating the tag name from the attribute is now emitted
through an explicit expression tag, matching the pattern already used
for conditional table attributes. Section headings now carry proper
id attributes and function as anchor targets when downstream changes
begin populating the identifier.
Fixes: QTBUG-145914
Change-Id: I92f71099b85351a5887ddd1c0d4024cba858159c
Reviewed-by: Topi Reinio <topi.reinio@qt.io>