Skip to content

Fix inline code in dashboard card titles being moved out of position#14647

Merged
cderv merged 1 commit into
mainfrom
fix/issue-14646
Jul 3, 2026
Merged

Fix inline code in dashboard card titles being moved out of position#14647
cderv merged 1 commit into
mainfrom
fix/issue-14646

Conversation

@cderv

@cderv cderv commented Jul 3, 2026

Copy link
Copy Markdown
Member

Inline verbatim code (backtick-formatted text) in a dashboard card title gets extracted from its original position and appended after the rest of the title, instead of staying inline where it was written.

Root Cause

The card-header loose-text extraction in src/format/dashboard/format-dashboard-card.ts only recognized text nodes, <em>, <strong> and inline math <span> as title content to pull into the .card-title wrapper. This logic was added in #10800 to fix #10340 for math, emphasis and bold, but never covered <code> nodes, so backtick-formatted text stayed behind in the header while everything else was extracted around it.

Fix

Add a <code> predicate alongside the existing text/em/strong/math checks. The regression test covers both the .card div title attribute and the executable cell #| title: option, plus a combined-formatting case (code, math, emphasis and bold together in one title) mirroring the existing #10340 coverage.

Fixes #14646

…14646)

The card-header loose-text extraction only recognized TEXT_NODE, EM,
STRONG and math SPAN as title content to move into the title wrapper
(added in #10800 for #10340). A CODE node was never added to that list,
so backtick-formatted text stayed behind in card-header while everything
else was extracted, landing at the far end of the flex header instead of
inline.
@posit-snyk-bot

posit-snyk-bot commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv cderv merged commit 2c89bd9 into main Jul 3, 2026
51 checks passed
@cderv cderv deleted the fix/issue-14646 branch July 3, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline verbatim code formatting mangles dashboard card titles Math in dashboard card titles ignores position in title

2 participants