Skip to content

Show typed HTML literally in user message bubbles - #4553

Merged
ymichael merged 1 commit into
mainfrom
bb/investigate-and-fix-issue-4546-thr_ec9zskjv5b
Sep 30, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/investigate-and-fix-issue-4546-thr_ec9zskjv5b

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

#4343 added allowHtml to the conversation MarkdownPreviews so that agent-written <video> would render. One of those was the user message bubble (CollapsibleMessageText). Because of that, any user message containing < went through the rehype-raw + rehype-sanitize pipeline, and typed tags like <details>, <b> and <img> rendered as real elements instead of the literal text. Before #4343, react-markdown turned those raw nodes into text.

What changed

  • apps/app/src/components/thread/timeline/ConversationMessageContent.tsx: removed allowHtml from the user bubble's MarkdownPreview. User messages render Markdown as before and show HTML tags literally. Assistant and generated messages still render sanitized HTML and <video>.
  • This is the fix the issue proposed.

How you verified

  • Added a test in ConversationMessageContent.test.tsx that renders a user message containing <details><summary>x</summary>hidden</details> and inline <b>bold</b> here. It asserts that no <details> or <b> elements exist and that the tags appear as literal text. The test fails without the fix and passes with it.
  • pnpm exec turbo run test --filter=@bb/app -- src/components/thread/timeline/ConversationMessageContent.test.tsx: 13/13 pass, including the assistant <video> routing and user image routing tests.
  • pnpm exec turbo run typecheck lint --filter=@bb/app: passes, 0 errors.
  • Not checked in the running app.

Fixes #4546

🤖 Generated with Claude Code

AGENT GENERATED

#4343 enabled allowHtml on the user bubble along with agent output, so
user-typed tags like <details> and <b> rendered as elements. Agent
output keeps sanitized HTML and <video>.

Fixes #4546

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit 27cf8ee into main Sep 30, 2026
20 checks passed
@ymichael
ymichael deleted the bb/investigate-and-fix-issue-4546-thr_ec9zskjv5b branch September 30, 2026 16:01
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.

User messages render raw HTML (<details>, <b>, <img>) instead of showing the typed text (regression from #4343)

1 participant