Skip to content

fix(ui): preserve line breaks in Info tooltip text - #3346

Closed
hpcnt-jerry-l wants to merge 1 commit into
evidence-dev:mainfrom
hpcnt-jerry-l:fix/info-tooltip-linebreaks
Closed

hpcnt-jerry-l wants to merge 1 commit into
evidence-dev:mainfrom
hpcnt-jerry-l:fix/info-tooltip-linebreaks

Conversation

@hpcnt-jerry-l

@hpcnt-jerry-l hpcnt-jerry-l commented Oct 2, 2026 •

Copy link
Copy Markdown

Summary

Info tooltip text containing newlines renders as a single line — line breaks are collapsed by the default white-space: normal.

Info tooltip content is rendered via Svelte text interpolation ({text}), so \n characters reach the DOM as text. Because white-space: normal collapses them into one line (<br> cannot be used — Svelte escapes it in text interpolation), multi-line tooltips (e.g. metric denominator explanations) become unreadable single lines. This change makes the tooltip preserve its line breaks.

Changes

  • core/src/user-components/tags/info/Info.svelte: add whitespace-pre-wrap to the tooltip <p> class. Pure CSS — no API or DOM changes.

Testing

  • Manual: a two-line tooltip renders with the line break preserved in serve.
  • No automated test added: user-components has no CSS-rendering test harness (jsdom does not apply stylesheet styles), and the change is a single CSS class.

Info tooltip content is rendered via Svelte text interpolation, so \n characters reach the DOM as text. Default white-space: normal collapses them into a single line (and <br> cannot be used - Svelte escapes it). Add whitespace-pre-wrap to the tooltip <p> so multi-line tooltips keep their line breaks.
@vercel

vercel Bot commented Oct 2, 2026

Copy link
Copy Markdown

@hpcnt-jerry-l is attempting to deploy a commit to the Evidence Team on Vercel.

A member of the Team first needs to authorize it.

@hpcnt-jerry-l hpcnt-jerry-l closed this by deleting the head repository Oct 5, 2026
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.

1 participant