diff --git a/src/command/render/defaults.ts b/src/command/render/defaults.ts index 27d8152b481..7883fc307a4 100644 --- a/src/command/render/defaults.ts +++ b/src/command/render/defaults.ts @@ -192,5 +192,19 @@ export function pandocDefaultsMessage( } } + // suppress the internal `quarto.*` template-variable namespace. It is + // populated by Quarto (e.g. the full localized language table, see + // quarto-template-variables.ts) and would otherwise flood the render + // message. This is print-only: the defaults file actually written for + // pandoc (writeDefaultsFile) keeps the namespace intact. Clone before + // the nested delete — defaults.variables aliases the caller's object. + if (defaults.variables && "quarto" in defaults.variables) { + defaults.variables = { ...defaults.variables }; + delete defaults.variables.quarto; + if (Object.keys(defaults.variables).length === 0) { + delete defaults.variables; + } + } + return stringify(defaults as Record); } diff --git a/tests/docs/smoke-all/markdown/lang-fr-no-console-leakage.qmd b/tests/docs/smoke-all/markdown/lang-fr-no-console-leakage.qmd new file mode 100644 index 00000000000..97c59700e50 --- /dev/null +++ b/tests/docs/smoke-all/markdown/lang-fr-no-console-leakage.qmd @@ -0,0 +1,21 @@ +--- +title: Test +lang: fr +format: markdown +_quarto: + tests: + markdown: + printsMessage: + - level: INFO + regex: "toc-title-document" + negate: true + - level: INFO + regex: "crossref-ch-prefix" + negate: true +--- + +# Section + +A paragraph in French (`lang: fr`). The internal `quarto.*` template +variable namespace must not flood the rendered pandoc defaults message +printed to the console. diff --git a/tests/docs/smoke-all/pdf-standard/ua2-unlabeled-figure-caption.qmd b/tests/docs/smoke-all/pdf-standard/ua2-unlabeled-figure-caption.qmd index 78b23fb391c..73c863cf2e7 100644 --- a/tests/docs/smoke-all/pdf-standard/ua2-unlabeled-figure-caption.qmd +++ b/tests/docs/smoke-all/pdf-standard/ua2-unlabeled-figure-caption.qmd @@ -1,5 +1,5 @@ --- -title: "UA-2: unlabeled figure caption produces invalid structure" +title: "UA-2: unlabeled figure caption passes verapdf validation" lang: en format: pdf: @@ -16,32 +16,27 @@ _quarto: - ['\\DocumentMetadata\{', 'pdfstandard=\{ua-2\}', 'tagging=on'] - [] printsMessage: - # Known issue: unlabeled captioned figures go through pandoc3_figure.lua - # which produces a bare \begin{figure}[H] environment. LaTeX's tagpdf - # places as a sibling of
under instead of - # nesting them inside a grouping element. This violates UA-2 which - # requires to be a child of
, , or . + # Unlabeled captioned figures go through pandoc3_figure.lua, which + # produces a bare \begin{figure}[H] environment. This historically + # produced an invalid UA-2 structure tree where tagpdf placed + #
as a sibling of
under instead of + # nesting them inside a grouping element, and verapdf flagged it. # - # Labeled figures ({#fig-label}) go through FloatRefTarget, which wraps - # the figure in a \Div that provides the grouping context tagpdf needs. - # - # Structure produced (invalid): - # /Document - # /Caption <- should be inside a grouping element - # /Figure <- sibling instead of parent - # - # Expected (valid, as produced by labeled figures): - # /Document - # /Div - # /Caption <- properly nested - # /Figure + # With the tagpdf/luamml versions in current TeX Live, verapdf now + # passes UA-2 validation for this document, so the failure warning + # should no longer appear. We negate the assertion to lock in that + # behavior. Whether the structure tree is genuinely conforming (vs. + # verapdf leniency) is tracked in issue #14570. level: WARN regex: "PDF validation failed for ua-2" + negate: true --- -# Known LaTeX tagging limitation +# Unlabeled figure caption tagging -An unlabeled captioned figure produces invalid UA-2 structure because -tagpdf does not nest `
` inside a grouping element. +An unlabeled captioned figure historically produced invalid UA-2 structure +because tagpdf did not nest `` inside a grouping element. With the +tagpdf/luamml versions in current TeX Live, verapdf now passes UA-2 +validation for this document (see issue #14570). ![This is a caption on an unlabeled figure](penrose.svg)