Repository navigation
feat: render markdown in message views - #106
Open
utpalsinghdev wants to merge 2 commits into
Open
utpalsinghdev wants to merge 2 commits into
utpalsinghdev wants to merge 2 commits into
Conversation
offendingcommit
requested changes
Oct 5, 2026
offendingcommit
left a comment
Owner
There was a problem hiding this comment.
Thanks, rendering Markdown in messages is a good change. The problem is the renderer: MarkdownRenderer is built for peer representations, and it rewrites ordinary message text in ways that break it:
preprocessContentstrips three leading spaces from every line, which mangles indented code and nested lists.Paragraphre-sorts and restyles paragraphs made of[YYYY-MM-DD HH:MM:SS]lines, so pasted logs come out in a different order.CITATION_REturns any[10+ char token]into a session-link chip.- A
## Inductive Observationsor## Contradictionsheading sends the text through the representation-only card parsers. - Dropping
whitespace-pre-wrapcollapses single newlines, so every multi-line plain-text message becomes one line. - Contrast: user bubbles in
ChatPagearevar(--accent)withcolor: #fff, butParagraph,ulandolhardcodecolor: var(--text-2). User text loses its white color on the accent background.
Suggested fix: add a small message renderer, e.g. MessageMarkdown, using plain react-markdown + remark-gfm + remark-breaks (or pre-wrap paragraphs). Have it inherit color from the bubble, and keep the same safe-link and no-raw-HTML settings. A test with a multi-line plain message and a [2026-01-01 00:00:00] line would pin both regressions.
Use a small GFM renderer in session and chat instead of the peer representation renderer.
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
Session messages and live chat currently show Markdown as raw syntax. Agent replies with headings, lists, code, and tables are hard to read.
This PR runs that content through the existing
MarkdownRenderer(react-markdown+remark-gfm) after demo-mode masking. Raw HTML stays inert.javascript:URLs are not executable links. Peer representations already use this renderer.Type
Test plan
pnpm lintpassespnpm testpasses@openconcho/webbuild succeedshttps://example.comlink<script>payload stayed visible as text and did not runRelated issues
Closes #88