Skip to content

feat(chat): add Markdown rendering for RAG chat messages#3075

Merged
marevol merged 1 commit intomasterfrom
feat/chat-markdown-rendering
Mar 15, 2026
Merged

feat(chat): add Markdown rendering for RAG chat messages#3075
marevol merged 1 commit intomasterfrom
feat/chat-markdown-rendering

Conversation

@marevol
Copy link
Contributor

@marevol marevol commented Mar 15, 2026

Summary

  • Integrate marked.js (v17.0.4) and DOMPurify for client-side Markdown rendering of LLM chat responses
  • Sanitization policy aligns with server-side MarkdownRenderer (OWASP sanitizer): allowed tags, rel="nofollow" on links, restricted class attribute
  • Add CSS styles for rendered Markdown elements (headings, tables, blockquotes, links, etc.)
  • Graceful fallback to plain text escaping if libraries fail to load

Test plan

  • Verify LLM responses render Markdown correctly (headings, lists, code blocks, tables, links)
  • Confirm XSS payloads are sanitized by DOMPurify
  • Check rel="nofollow" is added to all rendered links
  • Verify streaming updates render progressively without flickering
  • Test fallback behavior when marked.js/DOMPurify are unavailable

🤖 Generated with Claude Code

Integrate marked.js and DOMPurify to render LLM responses as sanitized
Markdown HTML instead of plain text. The sanitization policy aligns with
the server-side MarkdownRenderer (OWASP sanitizer) for consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@marevol marevol self-assigned this Mar 15, 2026
@marevol marevol added this to the 15.6.0 milestone Mar 15, 2026
@marevol marevol merged commit df2d590 into master Mar 15, 2026
1 check passed
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.

1 participant