Skip to content

Commit a9e4f39

Browse files
authored
Merge pull request #1029 from quarto-dev/reveal-stretch-aside
[reveal] do not apply auto-stretch if aside is used
2 parents d3a6418 + e2cbb7f commit a9e4f39

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/format/reveal/format-reveal.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,15 +645,17 @@ function applyStretch(doc: Document, autoStretch: boolean) {
645645
const image = images[0];
646646
const imageEl = image as Element;
647647

648-
// screen out early specials divs (layout panels, columns, fragments, ...)
649648
if (
649+
// screen out early specials divs (layout panels, columns, fragments, ...)
650650
findParent(imageEl, (el: Element) => {
651651
return el.classList.contains("column") ||
652652
el.classList.contains("quarto-layout-panel") ||
653653
el.classList.contains("fragment") ||
654654
el.classList.contains(kOutputLocationSlide) ||
655655
!!el.className.match(/panel-/);
656-
})
656+
}) ||
657+
// Do not autostrech if an aside is used
658+
slideEl.querySelectorAll("aside").length !== 0
657659
) {
658660
continue;
659661
}

tests/docs/reveal/stretch.qmd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,12 @@ Some content
234234
plot(cars)
235235
```
236236

237+
:::
238+
239+
## With aside on slide {#aside}
240+
241+
![Caption](https://revealjs.com/images/logo/reveal-black-text.svg)
242+
243+
::: {.aside}
244+
Something here as an aside
237245
:::

tests/smoke/render/render-reveal.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@ testRender(input, "revealjs", false, [
6666
"#custom-divs-caption img.r-stretch",
6767
"#custom-divs-knitr img.r-stretch",
6868
"#custom-divs-knitr-caption img.r-stretch",
69+
"#aside img.r-stretch",
6970
]),
7071
]);

0 commit comments

Comments
 (0)