You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Layout: tag a Preformatted block that holds code as P > Code #663
Preformatted (#591, v2.4) tags each drawn piece of a block as a P, as a paragraph is tagged. A preformatted
block need not be code, so P is right for the element as defined. When the block is code, ISO 14289-1 7.2 asks for
"the most semantically appropriate tag", and a P alone falls short in a PDF/UA-1 or PDF/A-2a file. No validator
checks this, so the gap is invisible to veraPDF.
Code is an inline-level structure type in ISO 32000-1 (Table 338) and is in the PDF 1.7 namespace only
(ISO 32000-2 Annex M).
ISO/TS 32005 Table 5 lets Code be a child of Document, Sect, Div or P and hold content items directly,
but not hold a P.
ISO 14289-2 8.2.5.32 requires computer code to be enclosed in Code.
So the shape is P > Code: one Code child per drawn piece, holding that piece's MCID.
Scope
An opt-in member on Preformatted that says the text is code (name decided in the brief), default off, so
documents that do not set it keep their bytes.
With it set and tagging on: P > Code per piece; untagged output unchanged.
Docs in the boundary pattern; CHANGELOG entry.
Acceptance
A tagged block with the opt-in has a P element whose child is Code holding the MCID, per piece; without it
the structure is the same as in v2.4 (pinned bytes).
veraPDF ua1 and 2a pass on a block with the opt-in.
Activity
feat(layout): add Preformatted, which keeps every space and tab (#662)
Tim81 commentedon Nov 29, 2026
The ISO audit (
docs/conformance-v2.4.md) has skipped tests that wait on this issue; the fix removes their skip and makes them pass.Iso14289_1_7_2_ACodeBlockIsAPHoldingACode(group G3)