feat(jetbrains): add MdView markdown rendering component#9149
Merged
Conversation
Add a standalone markdown rendering component for the JetBrains plugin using commonmark-java. This will be used in the chat UI to render assistant messages as formatted markdown instead of plain text. - Abstract MdView class with factory method and private HTML implementation - Configurable styling (font, colors, opacity/transparency) - Link click listeners via inner LinkListener interface - Streaming-friendly set/append/clear API - 44 unit tests covering rendering, styling, links, and transparency
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by gpt-5.4-20260305 · 1,168,602 tokens |
- Enable escapeHtml and sanitizeUrls on the commonmark HtmlRenderer to prevent raw HTML injection and dangerous URL schemes - Fix LinkEvent.point to use MouseEvent.point instead of the component's origin coordinates
- Replace plain JEditorPane + manual CSS with JBHtmlPane, the IntelliJ platform's flagship HTML component - Font and colours now default to the global editor colour scheme via JBHtmlPane's built-in EditorCssFontResolver and colorSchemeProvider - Code font defaults to _EditorFontNoLigatures_ placeholder resolved by EditorCssFontResolver at render time - All style properties become optional overrides applied via a customStyleSheetProvider; the override sheet is empty until a property is set, so editor defaults always win unless explicitly overridden - Add resetStyles() to revert all overrides back to editor defaults - Transparency (opaque=false) handled by Swing isOpaque + transparent CSS body rule; no manual background injection when transparent - Update tests to use overrideSheet() and component state assertions
catrielmuller
approved these changes
Apr 20, 2026
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.
Summary
Adds a standalone
MdViewmarkdown rendering component for the JetBrains plugin, for future use in the chat UI to render assistant messages as formatted markdown instead of plain text.MdView.html()) — the rendering backend is fully hidden and swappable laterJBHtmlPane— the IntelliJ platform's native HTML component — so font and colours automatically follow the global editor colour scheme and editor font settings out of the box_EditorFontNoLigatures_placeholder, resolved at render time byEditorCssFontResolverto the actual editor monospace fontresetStyles()reverts all overrides back to editor defaultsopaque = false) handled by SwingisOpaque+ abackground: transparentCSS body rule; no background is forced when transparentLinkListenerinterface with correct mouse-event coordinatesescapeHtml,sanitizeUrls) to prevent injection from model outputresetStyles