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
6 changes: 4 additions & 2 deletions src/format/reveal/format-reveal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,15 +645,17 @@ function applyStretch(doc: Document, autoStretch: boolean) {
const image = images[0];
const imageEl = image as Element;

// screen out early specials divs (layout panels, columns, fragments, ...)
if (
// screen out early specials divs (layout panels, columns, fragments, ...)
findParent(imageEl, (el: Element) => {
return el.classList.contains("column") ||
el.classList.contains("quarto-layout-panel") ||
el.classList.contains("fragment") ||
el.classList.contains(kOutputLocationSlide) ||
!!el.className.match(/panel-/);
})
}) ||
// Do not autostrech if an aside is used
slideEl.querySelectorAll("aside").length !== 0
) {
continue;
}
Expand Down
8 changes: 8 additions & 0 deletions tests/docs/reveal/stretch.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,12 @@ Some content
plot(cars)
```

:::

## With aside on slide {#aside}

![Caption](https://revealjs.com/images/logo/reveal-black-text.svg)

::: {.aside}
Something here as an aside
:::
1 change: 1 addition & 0 deletions tests/smoke/render/render-reveal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,6 @@ testRender(input, "revealjs", false, [
"#custom-divs-caption img.r-stretch",
"#custom-divs-knitr img.r-stretch",
"#custom-divs-knitr-caption img.r-stretch",
"#aside img.r-stretch",
]),
]);