diff --git a/src/resources/filters/normalize/normalize.lua b/src/resources/filters/normalize/normalize.lua index 121b571ddc7..08439f53f21 100644 --- a/src/resources/filters/normalize/normalize.lua +++ b/src/resources/filters/normalize/normalize.lua @@ -20,7 +20,16 @@ local authors = require 'modules/authors' local license = require 'modules/license' local shortcode_ast = require 'modules/astshortcode' -function normalize_filter() +-- Convert block-level metadata to inline for fields rendered inside

tags. +-- Multi-line YAML values produce MetaBlocks (Para), which nest

in

— invalid HTML5. +local function ensureMetaInlines(meta, field) + local val = meta[field] + if val ~= nil and quarto.utils.type(val) == "Blocks" then + meta[field] = quarto.utils.as_inlines(val) + end +end + +function normalize_filter() return { Meta = function(meta) -- normalizes the author/affiliation metadata @@ -32,6 +41,9 @@ function normalize_filter() -- normalizes the license metadata normalized = license.processLicenseMeta(normalized) + -- Convert block-level metadata to inline for fields rendered in

tags + ensureMetaInlines(normalized, "subtitle") + -- for JATs, forward keywords or categories to tags if _quarto.format.isJatsOutput() then if normalized.tags == nil then diff --git a/tests/docs/smoke-all/2026/02/16/issue-13827-multiline.qmd b/tests/docs/smoke-all/2026/02/16/issue-13827-multiline.qmd new file mode 100644 index 00000000000..c6ca79c9f4d --- /dev/null +++ b/tests/docs/smoke-all/2026/02/16/issue-13827-multiline.qmd @@ -0,0 +1,24 @@ +--- +title: Test Title +subtitle: | + First Part + + Second Part +format: + html: default + revealjs: default +_quarto: + tests: + html: + ensureHtmlElementContents: + selectors: ['p.subtitle'] + matches: ['First Part'] + revealjs: + ensureHtmlElementContents: + selectors: ['p.subtitle'] + matches: ['First Part'] +--- + +## Test Content + +This tests that a multi-paragraph | scalar subtitle stays inside the subtitle class. diff --git a/tests/docs/smoke-all/2026/02/16/issue-13827.qmd b/tests/docs/smoke-all/2026/02/16/issue-13827.qmd new file mode 100644 index 00000000000..01d462d5bf5 --- /dev/null +++ b/tests/docs/smoke-all/2026/02/16/issue-13827.qmd @@ -0,0 +1,22 @@ +--- +title: Test Title +subtitle: | + A Single Line Subtitle +format: + html: default + revealjs: default +_quarto: + tests: + html: + ensureHtmlElementContents: + selectors: ['p.subtitle'] + matches: ['A Single Line Subtitle'] + revealjs: + ensureHtmlElementContents: + selectors: ['p.subtitle'] + matches: ['A Single Line Subtitle'] +--- + +## Test Content + +This tests that a single-line | scalar subtitle stays inside the subtitle class.