Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/resources/filters/normalize/normalize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 <p> tags.
-- Multi-line YAML values produce MetaBlocks (Para), which nest <p> in <p> — 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
Expand All @@ -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 <p> tags
ensureMetaInlines(normalized, "subtitle")

-- for JATs, forward keywords or categories to tags
if _quarto.format.isJatsOutput() then
if normalized.tags == nil then
Expand Down
24 changes: 24 additions & 0 deletions tests/docs/smoke-all/2026/02/16/issue-13827-multiline.qmd
Original file line number Diff line number Diff line change
@@ -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.
22 changes: 22 additions & 0 deletions tests/docs/smoke-all/2026/02/16/issue-13827.qmd
Original file line number Diff line number Diff line change
@@ -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.
Loading