Skip to content

Commit

Permalink
Merge pull request #11550 from quarto-dev/bugfix/issue-11549
Browse files Browse the repository at this point in the history
Ensure loose text trims to non-empty in dashboard card title discovery
  • Loading branch information
cscheid authored Dec 12, 2024
2 parents 83a3b5a + 20d5537 commit d980d57
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
1 change: 1 addition & 0 deletions news/changelog-1.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All changes included in 1.7:

- ([#11509](https://github.com/quarto-dev/quarto-cli/issues/11509)): Fix link-decoration regression in HTML formats.
- ([#11532](https://github.com/quarto-dev/quarto-cli/issues/11532)): Fix regression for [#660](https://github.com/quarto-dev/quarto-cli/issues/660), which causes files to have incorrect permissions when Quarto is installed in a location not writable by the current user.
- ([#11549](https://github.com/quarto-dev/quarto-cli/issues/11549)): Fix regression in rendering `dashboard` tabsets into cards without titles.
- ([#11580](https://github.com/quarto-dev/quarto-cli/issues/11580)): Fix regression with documents containing `categories` fields that are not strings.

## YAML validation
Expand Down
9 changes: 5 additions & 4 deletions src/format/dashboard/format-dashboard-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,11 @@ export function processCards(doc: Document, dashboardMeta: DashboardMeta) {

for (const headerChildNode of Array.from(cardHeaderEl.childNodes)) {
if (
isText(headerChildNode) ||
isEmphasis(headerChildNode) ||
isBold(headerChildNode) ||
isMath(headerChildNode)
(isText(headerChildNode) ||
isEmphasis(headerChildNode) ||
isBold(headerChildNode) ||
isMath(headerChildNode)) &&
headerChildNode.textContent.trim() !== ""
) {
looseText.push(headerChildNode);
headerChildNode.parentNode?.removeChild(headerChildNode);
Expand Down
30 changes: 30 additions & 0 deletions tests/docs/smoke-all/2024/11/27/issue-11549.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: "test"
format: dashboard
_quarto:
tests:
dashboard:
ensureHtmlElements:
- [".dashboard-card-no-title"]
- []
---

# Page {orientation="rows" scrolling="true"}

## Row - Tabsets

### Column - Tabset1 {.tabset}

```{r}
#| label: Tabset1
#| title: "Tabset1"
print("Tabset1")
```

```{r}
#| label: Tabset2
#| title: "Tabset2"
print("Tabset2")
```

0 comments on commit d980d57

Please sign in to comment.