Skip to content

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

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

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

Conversation

@Junyeopp

@Junyeopp Junyeopp commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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 5, 2026

Copy link
Copy Markdown

@Junyeopp is attempting to deploy a commit to the Evidence Team on Vercel.

A member of the Team first needs to authorize it.

@hughess

hughess commented Oct 6, 2026

Copy link
Copy Markdown
Member

/upstream

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Imported for internal review, this PR will be updated when it merges.

@hughess

hughess commented Oct 7, 2026

Copy link
Copy Markdown
Member

Thanks for the contribution, @Junyeopp! Merged upstream, and synced back in defaa31

@hughess hughess closed this Oct 7, 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.

2 participants