Skip to content

fix(react): prevent intra-word _ and * from rendering as emphasis - #1375

Open
rahulnits-sketch wants to merge 1 commit into
RocketChat:developfrom
rahulnits-sketch:fix/intra-word-emphasis
Open

rahulnits-sketch wants to merge 1 commit into
RocketChat:developfrom
rahulnits-sketch:fix/intra-word-emphasis

Conversation

@rahulnits-sketch

@rahulnits-sketch rahulnits-sketch commented Sep 23, 2026 •

Copy link
Copy Markdown

Brief Title

fix(react): prevent intra-word _ and * from rendering as emphasis in composer

Acceptance Criteria fulfillment

  • Prevent intra-word _ and * delimiters from being parsed as italics or bold (e.g. my_file_name.js, foo_bar_baz)
  • Ensure delimiters touching whitespace (e.g. 2 * 3 * 4) do not trigger emphasis
  • Retain expected markdown behavior for valid bold/italic spans (e.g. _italic_, **bold**, (_italic_))
  • All 10 workspace packages build successfully via yarn build

Fixes #1372

PR Test Details

Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-1375 after approval.

Test Matrix

Input Before (Bug) After (Fixed)
my_file_name.js my<em>file</em>name.js my_file_name.js
call foo_bar_baz() now call foo<em>bar</em>baz() now call foo_bar_baz() now
2 * 3 * 4 = 24 2 <em> 3 </em> 4 = 24 2 * 3 * 4 = 24
This is _italic_ text This is <em>italic</em> text This is <em>italic</em> text
This is **bold** text This is <strong>bold</strong> text This is <strong>bold</strong> text
(_italic_) (<em>italic</em>) (<em>italic</em>)

@CLAassistant

CLAassistant commented Sep 23, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@rahulnits-sketch

Copy link
Copy Markdown
Author

Hi @Spiral-Memory,

I have updated the commit author to align with my signed CLA, so all checks (including the CLA assistant) are now passing green ✅.

The changes in contentEditableComposer.js have been tested against all intra-word edge cases and all 10 workspace packages compile cleanly via yarn build. Whenever you have a moment, I would appreciate your review and feedback. Thank you!

This branch has not been deployed

No deployments
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.

bug: AI composer renders intra-word _ and * as italic/bold (e.g. my_file_name.js -> my<em>file</em>name.js)

2 participants