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
4 changes: 4 additions & 0 deletions news/changelog-1.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ All changes included in 1.10:
- ([#14354](https://github.com/quarto-dev/quarto-cli/pull/14354)): Fix trailing whitespace after author name on title slide when ORCID is not set. (author: @jnkatz)
- ([#14585](https://github.com/quarto-dev/quarto-cli/issues/14585)): Fix empty blockquote (`> `) crashing render for revealjs format.

### `dashboard`

- ([#14646](https://github.com/quarto-dev/quarto-cli/issues/14646)): Fix inline code formatting in a dashboard card title being extracted from its original position and appended elsewhere in the header instead of staying inline, the same issue previously fixed for math, emphasis and bold in [#10340](https://github.com/quarto-dev/quarto-cli/issues/10340).

## Projects

### Manuscripts
Expand Down
2 changes: 2 additions & 0 deletions src/format/dashboard/format-dashboard-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export function processCards(doc: Document, dashboardMeta: DashboardMeta) {
const isText = (node: Node) => node.nodeType === Node.TEXT_NODE;
const isEmphasis = (node: Node) => node.nodeName === "EM";
const isBold = (node: Node) => node.nodeName === "STRONG";
const isCode = (node: Node) => node.nodeName === "CODE";
const isMath = (node: Node) =>
node.nodeName === "SPAN" &&
(node as Element).classList.contains("math") &&
Expand All @@ -169,6 +170,7 @@ export function processCards(doc: Document, dashboardMeta: DashboardMeta) {
(isText(headerChildNode) ||
isEmphasis(headerChildNode) ||
isBold(headerChildNode) ||
isCode(headerChildNode) ||
isMath(headerChildNode)) &&
headerChildNode.textContent.trim() !== ""
) {
Expand Down
51 changes: 51 additions & 0 deletions tests/docs/smoke-all/2026/07/03/issue-14646.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: "Card titles with inline code (issue #14646)"
format: dashboard
_quarto:
tests:
dashboard:
ensureHtmlElements:
-
- ".test-attr-code .card-title code"
- ".cell .card-title code"
- ".test-combined .card-title code"
-
- ".test-attr-code .card-header > code"
- ".cell .card-header > code"
- ".test-combined .card-header > code"
- ".test-combined .card-header > span.math.inline"
- ".test-combined .card-header > em"
- ".test-combined .card-header > strong"
---

Regression test for #14646. Inline verbatim code (backtick) formatting in
dashboard card titles was extracted from its original position and appended
after the rest of the title text, instead of staying inline where it was
written — the same bug previously fixed for math, emphasis and bold in
#10340. The card `title` attribute and the executable cell `title` option
both build the card header through the same code path, so both forms are
covered here. Each card carries its own scoping class (or relies on the
executable cell's implicit `.cell` class) so a failure in one card cannot
be masked by another card's passing assertion.

## card title attribute

::: {.card .test-attr-code title="Inline `code` between words"}

:::

## executable cell title option

```{python}
#| title: "Inline `code` between words"
1 + 1
```

## combined formatting

Code alongside math, emphasis and bold in the same title exercises the
same loose-text extraction loop that #10340 covers without code.

::: {.card .test-combined title="`code`, $math$, *em*, and **bold** together"}

:::
Loading