From f344c2f3ae73bab7d2cfa7667cb3579e64928ffc Mon Sep 17 00:00:00 2001
From: A-G0D <143042805+A-G0D@users.noreply.github.com>
Date: Tue, 3 Nov 2026 23:06:00 -0600
Subject: [PATCH] Reset Pandoc's invented widths for raw HTML tables
Pandoc's HTML reader assigns 1 / ncols to every column when a table has
block content and no
widths. Quarto wrote those widths back as a
, overriding widths set on the cells. Reset the column widths
to the default when the source declares none.
Fixes #15219
Signed-off-by: A-G0D <143042805+A-G0D@users.noreply.github.com>
---
news/changelog-1.12.md | 1 +
.../filters/normalize/astpipeline.lua | 9 +++++++++
.../docs/smoke-all/2026/11/03/issue-15219.qmd | 20 +++++++++++++++++++
3 files changed, 30 insertions(+)
create mode 100644 tests/docs/smoke-all/2026/11/03/issue-15219.qmd
diff --git a/news/changelog-1.12.md b/news/changelog-1.12.md
index 862d32b463f..5e2c38b2251 100644
--- a/news/changelog-1.12.md
+++ b/news/changelog-1.12.md
@@ -22,6 +22,7 @@ All changes included in 1.12:
- ([#14822](https://github.com/quarto-dev/quarto-cli/issues/14822)): Translate the `tools-share`, `tools-download`, and `skip-to-content` language keys in Greek. (author: @sogav21)
- ([#14822](https://github.com/quarto-dev/quarto-cli/issues/14822)): The Lithuanian search label and the Swedish caution callout title no longer fall back to English.
- ([#15126](https://github.com/quarto-dev/quarto-cli/issues/15126)): Translate the `revealjs-menu-button-label` language key in Brazilian Portuguese. (author: @bonijoao)
+- ([#15219](https://github.com/quarto-dev/quarto-cli/issues/15219)): Tables written as raw HTML no longer get equal-width `` columns when a cell contains block content, so widths set on table cells apply.
- ([#15223](https://github.com/quarto-dev/quarto-cli/pull/15223)): Directories are now read in a fixed order (sorted by name in character-code order, not by locale) on every platform.
Extension discovery, the theme list of `quarto capabilities`, and the items of a MECA bundle no longer depend on the file system's listing order; when two extensions share an id, which one wins can differ from earlier versions.
- ([#15268](https://github.com/quarto-dev/quarto-cli/issues/15268)): Translate the `skip-to-content` language key in Bulgarian, Catalan, Czech, Danish, Finnish, Hebrew, Indonesian, Korean, Lithuanian, Norwegian Bokmål, Norwegian Nynorsk, Polish, Russian, Serbian (Latin), Slovak, Slovenian, Swedish, Turkish and Ukrainian, using reviewed machine translation.
diff --git a/src/resources/filters/normalize/astpipeline.lua b/src/resources/filters/normalize/astpipeline.lua
index 11b148ded64..9177ca01f9e 100644
--- a/src/resources/filters/normalize/astpipeline.lua
+++ b/src/resources/filters/normalize/astpipeline.lua
@@ -167,12 +167,21 @@ function quarto_ast_pipeline()
local tableDoc = pandoc.read(tableHtml, "html+raw_html")
local found = false
local skip = false
+ -- Pandoc fills in 1/ncols widths for tables with block content
+ -- when the source declares no widths; those are not
+ -- author widths, so discard them.
+ local hasColWidths = tableHtml:lower():find("][^>]*width%s*[:=]")
_quarto.traverser(tableDoc, {
Table = function(table)
found = true
if table.attributes[constants.kDisableProcessing] == "true" then
skip = true
end
+ if not hasColWidths then
+ for _, spec in ipairs(table.colspecs) do
+ spec[2] = nil
+ end
+ end
end,
})
if #tableDoc.blocks ~= 1 then
diff --git a/tests/docs/smoke-all/2026/11/03/issue-15219.qmd b/tests/docs/smoke-all/2026/11/03/issue-15219.qmd
new file mode 100644
index 00000000000..da51ba6ab12
--- /dev/null
+++ b/tests/docs/smoke-all/2026/11/03/issue-15219.qmd
@@ -0,0 +1,20 @@
+---
+format: html
+_quarto:
+ tests:
+ html:
+ ensureHtmlElements:
+ - []
+ - ['colgroup']
+---
+
+```{=html}
+
+```