diff --git a/src/format/html/format-html-bootstrap.ts b/src/format/html/format-html-bootstrap.ts index 12792bb2a04..8648bd3e0d9 100644 --- a/src/format/html/format-html-bootstrap.ts +++ b/src/format/html/format-html-bootstrap.ts @@ -1159,7 +1159,10 @@ function processColumnElements( // Add the grid system. Children of the grid system // are placed into the body-content column by default // (CSS implements this) - if (!el.classList.contains("page-columns")) { + if ( + !el.classList.contains("quarto-layout-row") && + !el.classList.contains("page-columns") + ) { el.classList.add("page-columns"); } diff --git a/tests/docs/smoke-all/2024/03/14/9076.qmd b/tests/docs/smoke-all/2024/03/14/9076.qmd new file mode 100644 index 00000000000..64f2917d633 --- /dev/null +++ b/tests/docs/smoke-all/2024/03/14/9076.qmd @@ -0,0 +1,97 @@ +--- +format: html +_quarto: + tests: + html: + ensureHtmlElements: + - [] + - ["div.quarto-layout-row.page-columns"] +--- + +::: {#fig-gapminder .cell .column-page layout-ncol='2' execution_count=1} + +```{.python .cell-code} +import plotly.express as px +import plotly.io as pio +gapminder = px.data.gapminder() +def gapminder_plot(year): + gapminderYear = gapminder.query("year == " + + str(year)) + fig = px.scatter(gapminderYear, + x="gdpPercap", y="lifeExp", + size="pop", size_max=60, + hover_name="country") + fig.show() + +gapminder_plot(1957) +gapminder_plot(1967) +``` + +::: {#fig-gapminder-1 .cell-output .cell-output-display} + +```{=html} +
+``` + +Gapminder: 1957 +::: + +::: {#fig-gapminder-2 .cell-output .cell-output-display} + +```{=html} +
+``` + +Gapminder: 1967 +::: + +Life Expectancy and GDP +:::