Fix inline code in dashboard card titles being moved out of position#14647
Merged
Conversation
…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.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsonly recognized text nodes,<em>,<strong>and inline math<span>as title content to pull into the.card-titlewrapper. 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.carddivtitleattribute 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