Repository navigation
fix: render Ask AI answers as markdown 📝 - #918
Merged
Merged
Conversation
Renders the Ask AI answer with react-markdown (plus remark-gfm for tables and remark-breaks to keep single line breaks) instead of raw text, so bold, lists, code and tables display properly. Thread references are turned into "#ref-N" links and rendered as the existing reference pills. Closes colorstackorg#914. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wisesofthemall
requested review from
levin0710,
queenellie873 and
ramiAbdou
as code owners
November 7, 2026 04:00
This was referenced Nov 7, 2026
3 of 9 tasks
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.
Description ✏️
Closes #914
The Ask AI answer was printed as raw text, so the model's markdown showed up literally (
**bold**,-and1.lists, backticks). This PR renders it withreact-markdown, so there's no parsing logic of our own. It replaces #915, #916 and #917, following the review feedback there.react-markdownrenders the answer, with two small official plugins:remark-gfmfor tables and auto-linked URLs.remark-breaksso a single newline still starts a new line. The oldwhitespace-break-spacesrendering kept every newline, and the model often writes lines that way.[ref:N]segment becomes a markdown link to#ref-N. Theaoverride turns those links back into the existingReferenceLinkpills, so citations still work inside lists, bold text and tables. Other links open in a new tab.@tailwindcss/typographyisn't installed, so the styles are explicit classes.react-markdowndoesn't render raw HTML by default, and images are disallowed, so the page never loads image URLs from the model.---as a divider.---separates the JSON block from the answer.Screenshots 📸
Taken locally on
/ask-ai. A sample answer was stored in Redis so the page renders it without calling the AI.main)Mobile (390px wide, no sideways page scroll), and the other markdown elements (headings, list styles, quote, table, code block, links):
Sample answer used for the before/after
Testing 🧪
/ask-aiwith sample answers stored in Redis (screenshots above). Checked:$5,000stay as textreact-router build,tscand ESLint pass formember-profile.Type of Change 🐞
Checklist ✅
🤖 Generated with Claude Code