Skip to content

Render markdown in session chat bubbles#348

Merged
mrcfps merged 2 commits intonexu-io:mainfrom
NickHood1984:feat/markdown-chat-rendering
Mar 23, 2026
Merged

Render markdown in session chat bubbles#348
mrcfps merged 2 commits intonexu-io:mainfrom
NickHood1984:feat/markdown-chat-rendering

Conversation

@NickHood1984
Copy link
Copy Markdown
Contributor

Summary

  • render session messages with a dedicated markdown component
  • escape raw HTML while enabling markdown links, code, and formatting
  • add focused session-page coverage for markdown rendering and safe links

Validation

  • pnpm exec biome check apps/web/package.json apps/web/src/pages/sessions.tsx apps/web/src/components/ui/chat-markdown.tsx apps/web/src/lib/markdown.ts apps/web/tests/sessions.test.tsx
  • pnpm --filter @nexu/web typecheck
  • pnpm --filter @nexu/web exec vitest run tests/sessions.test.tsx

Notes

  • kept the diff scoped to the markdown-rendering feature only

Copy link
Copy Markdown
Contributor

@mrcfps mrcfps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused markdown rendering update. I found one blocking issue before this can merge: the current markdown-it setup keeps the default image rule enabled, so chat content like ![tracker](https://example.com/pixel) will render a real <img> and trigger a third-party request when the session page opens. That is a privacy/security regression compared with plain-text rendering. Please disable markdown images (for example by starting from the zero preset or disabling the image rule explicitly) and add a regression test proving image markdown does not produce an <img> tag.

Comment thread apps/web/src/lib/markdown.ts
@mrcfps mrcfps merged commit 699859a into nexu-io:main Mar 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants