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
1 change: 1 addition & 0 deletions news/changelog-1.11.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ All changes included in 1.11:

- ([#14818](https://github.com/quarto-dev/quarto-cli/issues/14818)): Fix a dashboard with more than one page going blank when the URL hash does not name a page, such as a footnote link or a cross-reference link.
- ([#14819](https://github.com/quarto-dev/quarto-cli/issues/14819)): Fix keyboard focus starting inside the page content when a dashboard opens at a page hash, such as `dashboard.html#sales`. Tabbing backward now correctly returns to the page navigation tabs.
- ([#15023](https://github.com/quarto-dev/quarto-cli/issues/15023)): Fix a dashboard cell's HTML output being moved out of its card when the output contains text such as `bslib` or the word "subslide", and the card being dropped, title included, when the cell shows nothing else. (author: @jooyoungseo)

### `html`

Expand Down
2 changes: 1 addition & 1 deletion src/resources/filters/quarto-post/dashboard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ function render_dashboard()
end

if #childDiv.content == 1 and childDiv.content[1].t == "RawBlock" and childDiv.content[1].format == "html" then
if childDiv.content[1].text:match('bslib-') ~= nil then
if childDiv.content[1].text:match('bslib%-') ~= nil then
-- capture any raw blocks that we see
bslibRawOutputs:insert(childDiv.content[1])

Expand Down
44 changes: 44 additions & 0 deletions tests/docs/smoke-all/2026/10/11/issue-15023.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: "HTML output mistaken for bslib output (issue #15023)"
format: dashboard
_quarto:
tests:
dashboard:
ensureHtmlElements:
-
- ".card.cell .test-subslide"
- ".card.cell .test-name"
- ".test-lifted"
-
- ".card.cell .test-lifted"
---

Regression test for #15023. The dashboard filter lifts a cell's raw HTML
output out of its card when it takes the output for bslib components,
which it detected with the Lua pattern `'bslib-'`. In a Lua pattern `-` is
a quantifier, so that pattern matched any text containing `bsli`: the word
"subslide", or the name `bslib` without a hyphen. Such output left its
card, and a card with nothing else in it was dropped, title and all.

The first two cells hold text like that and must keep their output in
their card. The third holds a `bslib-` class, as real bslib components do,
and must still be lifted out of the card. The selectors name `.card.cell`,
the card built from a cell: when every output is lifted, the dashboard
wraps what is left of the page, these outputs included, in a card of its
own, which carries no `.cell` class.

```{python}
#| title: A word
from IPython.display import HTML
HTML('<p class="test-subslide">A subslide of the deck</p>')
```

```{python}
#| title: A name without a hyphen
HTML('<p class="test-name">Cards are built by bslib</p>')
```

```{python}
#| title: A bslib component
HTML('<div class="bslib-mock test-lifted">Component</div>')
```
Loading