KEMBAR78
feat: add markdown support to tooltip by sissbruecker · Pull Request #10245 · vaadin/web-components · GitHub
Skip to content

Conversation

@sissbruecker
Copy link
Contributor

@sissbruecker sissbruecker commented Sep 26, 2025

Description

Adds Markdown support to vaadin-tooltip. This introduces a markdown property, which when enabled parses the tooltip content as Markdown and renders the corresponding HTML into the overlay.

This adds a dependency on vaadin-markdown to get access to the renderMarkdownToElement helper. Similar to how vaadin-message dynamically imports the vaadin-markdown component when enabling Markdown mode, the helper is imported dynamically at runtime. This avoids pulling the marked and dompurify dependencies into the main bundle if Markdown is not used, and instead allows code-splitting those in a separate chunk.

Part of #9771

Type of change

  • Feature

@sissbruecker sissbruecker marked this pull request as ready for review October 1, 2025 07:33
Copy link
Member

@web-padawan web-padawan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, but I wonder why the dev page looks differently compared to the Lumo screenshot, especially these newlines:

Screenshot 2025-10-02 at 16 31 04

@sissbruecker
Copy link
Contributor Author

Mhh, I can not reproduce that. It should be fixed by splitting up these CSS rules:

[part='content'] {
padding: var(--lumo-space-xs) var(--lumo-space-s);
}
:host(:not([markdown])) [part='content'] {
white-space: pre-wrap;
}

@web-padawan web-padawan force-pushed the feat/tooltip-markdown-support branch from a9efd1a to 191bc14 Compare October 2, 2025 13:50
@web-padawan
Copy link
Member

Mhh, I can not reproduce that. It should be fixed by splitting up these CSS rules:

My bad, was a browser caching issue (apparently web dev server config needs some tweaks to not cache CSS).

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 2025

@web-padawan web-padawan changed the title feat: tooltip markdown support feat: add markdown support to tooltip Oct 2, 2025
@web-padawan web-padawan merged commit 322c15b into main Oct 2, 2025
9 checks passed
@web-padawan web-padawan deleted the feat/tooltip-markdown-support branch October 2, 2025 14:09
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 25.0.0-alpha14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants