Skip to content

Fix backslash escaping in chat messages with hard breaks#511

Merged
wesbillman merged 1 commit into
mainfrom
fix/strip-backslash-hard-breaks
May 8, 2026
Merged

Fix backslash escaping in chat messages with hard breaks#511
wesbillman merged 1 commit into
mainfrom
fix/strip-backslash-hard-breaks

Conversation

@wesbillman
Copy link
Copy Markdown
Collaborator

Summary

  • tiptap-markdown serializes hard break nodes as \ + newline (CommonMark hard line break syntax), but our chat messages are plain text — the literal backslashes were leaking into message content on the relay
  • Most visible when a line ends with a colon followed by a numbered list (e.g., This has a colon:\ instead of This has a colon:)
  • Strips \ + newline sequences from getMarkdownFromEditor() output before content reaches the composer state

Test plan

  • Type a message ending with a colon, press Enter, type a numbered list — verify no backslashes appear in the sent message
  • Type a multi-line message with Shift+Enter breaks — verify newlines are preserved without backslashes
  • Paste formatted text with lists — verify clean newlines
  • Forum composer also uses useRichTextEditor — verify forum posts are also clean

🤖 Generated with Claude Code

tiptap-markdown serializes hard break nodes as "\" + newline (CommonMark
hard line break syntax). Chat messages are plain text, not rendered
markdown, so the literal backslashes were leaking into message content
on the relay — most visibly when a line ended with a colon followed by
a numbered list.

Strip backslash-newline sequences from getMarkdownFromEditor() output
before the content reaches the composer state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wesbillman wesbillman merged commit e357d53 into main May 8, 2026
15 checks passed
@wesbillman wesbillman deleted the fix/strip-backslash-hard-breaks branch May 8, 2026 17:20
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.

1 participant