{"record":{"id":"525426f4f31a3285","repo":"typst/typst","slug":"invalid-document-structure-this-element-s-pdf-tag","errorCode":null,"errorMessage":"invalid document structure, this element's PDF tag would be split up","messagePattern":"invalid document structure, this element's PDF tag would be split up","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/typst-pdf/src/tags/tree/build.rs","lineNumber":663,"sourceCode":"        (None, Some(_)) => Ok(split_inner_groups(tree, outer.parent, stack_idx)),\n        (None, None) => {\n            let non_breakable_span = inner_non_breakable_span.or(outer.span);\n\n            let non_breakable_in_pdf_ua = inner_non_breakable_in_pdf_ua\n                || matches!(outer_break_opportunity, BreakOpportunity::NoPdfUa(_));\n\n            if non_breakable_in_pdf_ua {\n                let validator =\n                    tree.options.standards.config.validators().to_comma_list();\n                bail!(\n                    non_breakable_span,\n                    \"{validator} error: invalid document structure, \\\n                     this element's PDF tag would be split up\";\n                    hint: \"this is probably caused by paragraph grouping\";\n                    hint: \"maybe you've used a `parbreak`, `colbreak`, or `pagebreak`\";\n                );\n            } else {\n                bail!(\n                    non_breakable_span,\n                    \"invalid document structure, \\\n                     this element's PDF tag would be split up\";\n                    hint: \"please report this as a bug\";\n                );\n            }\n        }\n    }\n}\n\n/// Consider the following introspection tags:\n/// ```txt\n/// start a\n///   start b\n///     start c\n/// end   a\n///     end   c\n///   end   b","sourceCodeStart":645,"sourceCodeEnd":681,"githubUrl":"https://github.com/typst/typst/blob/6a6f1a97a3446fc6ba5a723b0baf20a0cfeaaef5/crates/typst-pdf/src/tags/tree/build.rs#L645-L681","documentation":"Raised in progress_tree_end when a tag element cannot be kept contiguous in the PDF tag tree and the affected span is non-breakable under PDF/UA rules (a BreakOpportunity::NoPdfUa was encountered). Unlike the validator-prefixed variant, this fires because PDF/UA conformance forbids splitting the element at all.","triggerScenarios":"Thrown at crates/typst-pdf/src/tags/tree/build.rs:663 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep the element on one page or within one region so its tag stays contiguous","Remove explicit keep-together or non-breakable constraints that conflict with the layout","Avoid nesting constructs whose tag structure cannot be preserved when broken"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6a6f1a97a3446fc6ba5a723b0baf20a0cfeaaef5","analyzedAt":"2026-08-17T21:03:48.984Z","contentChangedAt":"2026-08-17T21:03:48.984Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}