From bb02d940c24cbacef20497051c203faec2294374 Mon Sep 17 00:00:00 2001 From: Gordon Woodhull Date: Fri, 16 Jan 2026 13:59:45 -0500 Subject: [PATCH 1/2] claude: fix column-margin with renderings option (#13825) Preserve existing classes on cell-output-display divs when applying light/dark theme classes in the cell-renderings filter. Previously, new divs were created that discarded existing classes like column-margin. Co-Authored-By: Claude Opus 4.5 --- .../filters/quarto-post/cell-renderings.lua | 7 +++-- .../dark-mode/renderings-column-margin.qmd | 27 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 tests/docs/smoke-all/dark-mode/renderings-column-margin.qmd diff --git a/src/resources/filters/quarto-post/cell-renderings.lua b/src/resources/filters/quarto-post/cell-renderings.lua index e7cd4534706..5de0f313e14 100644 --- a/src/resources/filters/quarto-post/cell-renderings.lua +++ b/src/resources/filters/quarto-post/cell-renderings.lua @@ -52,8 +52,11 @@ function choose_cell_renderings() blocks:insert(darkDiv) end elseif quarto.format.isHtmlOutput() and lightDiv and darkDiv then - blocks:insert(pandoc.Div(lightDiv.content, pandoc.Attr("", {'light-content'}, {}))) - blocks:insert(pandoc.Div(darkDiv.content, pandoc.Attr("", {'dark-content'}, {}))) + -- Preserve existing classes (e.g., column-margin, cell-output-display) and add theme class + lightDiv.classes:insert('light-content') + darkDiv.classes:insert('dark-content') + blocks:insert(lightDiv) + blocks:insert(darkDiv) else blocks:insert(lightDiv or darkDiv) end diff --git a/tests/docs/smoke-all/dark-mode/renderings-column-margin.qmd b/tests/docs/smoke-all/dark-mode/renderings-column-margin.qmd new file mode 100644 index 00000000000..ea6d3cc0ae7 --- /dev/null +++ b/tests/docs/smoke-all/dark-mode/renderings-column-margin.qmd @@ -0,0 +1,27 @@ +--- +title: "renderings with column-margin" +format: + html: + theme: + light: flatly + dark: darkly +_quarto: + tests: + html: + ensureHtmlElements: + - + - 'div.cell div.column-margin div.cell-output-display.light-content' + - 'div.cell div.column-margin div.cell-output-display.dark-content' + - [] +--- + +This tests that `column: margin` works together with `renderings: [light, dark]`. +The column-margin class should be preserved when creating light/dark content divs. + +```{r} +#| column: margin +#| renderings: [light, dark] + +knitr::kable(data.frame(x = "Light mode", y = 1)) +knitr::kable(data.frame(x = "Dark mode", y = 2)) +``` From d3412244e94c295e6e0c400fdc013d799f0497ca Mon Sep 17 00:00:00 2001 From: Gordon Woodhull Date: Fri, 16 Jan 2026 14:22:21 -0500 Subject: [PATCH 2/2] claude: add changelog entry for #13825 Co-Authored-By: Claude Opus 4.5 --- news/changelog-1.9.md | 1 + 1 file changed, 1 insertion(+) diff --git a/news/changelog-1.9.md b/news/changelog-1.9.md index 14f341aa6d9..9cbd373b0cc 100644 --- a/news/changelog-1.9.md +++ b/news/changelog-1.9.md @@ -32,6 +32,7 @@ All changes included in 1.9: - ([#11929](https://github.com/quarto-dev/quarto-cli/issues/11929)): Import all `brand.typography.fonts` in CSS, whether or not fonts are referenced by typography elements. - ([#13413](https://github.com/quarto-dev/quarto-cli/issues/13413)): Fix uncentered play button in `video` shortcodes from cross-reference divs. (author: @bruvellu) - ([#13508](https://github.com/quarto-dev/quarto-cli/issues/13508)): Add `aria-label` support to `video` shortcode for improved accessibility. +- ([#13825](https://github.com/quarto-dev/quarto-cli/issues/13825)): Fix `column: margin` not working with `renderings: [light, dark]` option. Column classes are now preserved when applying theme classes to cell outputs. ### `typst`