fix: replace marked+DOMPurify with react-markdown, add stable message keys#9
Merged
quiet-node merged 1 commit intomainfrom Mar 31, 2026
Merged
Conversation
…age keys Replace the marked + DOMPurify + dangerouslySetInnerHTML markdown pipeline with react-markdown, which renders markdown as React elements directly — eliminating the XSS surface and the ESLint dangerouslySetInnerHTML warning. Add unique IDs to Message objects to fix the array-index-as-key warning. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
783296b to
85438f8
Compare
This was referenced Apr 5, 2026
quiet-node
added a commit
that referenced
this pull request
Apr 10, 2026
… keys (#9) fix: replace marked+DOMPurify with react-markdown and add stable message keys Replace the marked + DOMPurify + dangerouslySetInnerHTML markdown pipeline with react-markdown, which renders markdown as React elements directly — eliminating the XSS surface and the ESLint dangerouslySetInnerHTML warning. Add unique IDs to Message objects to fix the array-index-as-key warning.
quiet-node
added a commit
that referenced
this pull request
Apr 10, 2026
… keys (#9) fix: replace marked+DOMPurify with react-markdown and add stable message keys Replace the marked + DOMPurify + dangerouslySetInnerHTML markdown pipeline with react-markdown, which renders markdown as React elements directly — eliminating the XSS surface and the ESLint dangerouslySetInnerHTML warning. Add unique IDs to Message objects to fix the array-index-as-key warning.
quiet-node
added a commit
that referenced
this pull request
Apr 11, 2026
… keys (#9) fix: replace marked+DOMPurify with react-markdown and add stable message keys Replace the marked + DOMPurify + dangerouslySetInnerHTML markdown pipeline with react-markdown, which renders markdown as React elements directly — eliminating the XSS surface and the ESLint dangerouslySetInnerHTML warning. Add unique IDs to Message objects to fix the array-index-as-key warning.
This was referenced Apr 11, 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
marked+DOMPurify+dangerouslySetInnerHTMLwithreact-markdown+remark-gfm. This eliminates thedangerouslySetInnerHTMLESLint warning by design — react-markdown renders markdown as React elements viacreateElement, never touching innerHTML. Raw HTML in markdown source is stripped by default, removing the XSS surface without needing an external sanitizer.id: stringto theMessageinterface, generated viacrypto.randomUUID()on each message creation.ConversationViewnow usesmsg.idas the React key, fixing the array-index-as-key ESLint warning.remark-gfmplugin enables GitHub Flavored Markdown (tables, strikethrough, task lists, autolinks) out of the box.Dependencies changed
react-markdownmarkedremark-gfmdompurify@types/marked@types/dompurifyTest plan
bun run lint— 0 errors, 0 warnings (was 2 warnings before)bun run format:check— all files passbun run typecheck— no type errorsbun run test:coverage— 137 tests pass, 100% coverage on all metrics🤖 Generated with Claude Code