bug: AI composer renders intra-word _ and * as italic/bold (e.g. my_file_name.js -> my<em>file</em>name.js)
Maintainer antworten meist innerhalb von 1 Tag
@rahulnits-sketch arbeitet bereits daran.
Seit 23.9.2026.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 76/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript, react
- Bereich
- frontend
Rechercherichtung
Start in packages/react/src/lib/contentEditableComposer.js, following renderComposerMarkdown into appendMarkdown, and run the provided jsdom reproduction from the repository root. Check the listed identifier, dunder, and arithmetic examples; the work is complete when intra-word underscores and asterisks remain literal while valid emphasis still renders correctly.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description:
The AI-composer Markdown renderer (renderComposerMarkdown → appendMarkdown in packages/react/src/lib/contentEditableComposer.js) treats any _, *, __ or ** as an emphasis marker, even when it appears inside a word. As a result, AI suggestions that contain code identifiers, file paths, dunder names, or arithmetic are silently corrupted into <em>/<strong> when rendered inline in the composer.
- EmbeddedChat
@rocket.chat/embeddedchat-react0.2.2 - Commit
0654e5c7774b9762ed84d4a2bfde89b8f878a9d6(branchdevelop) - Node v24.0.0, OS macOS
Steps to reproduce:
-
Check out
developat commit0654e5c. -
Render a string through the composer's Markdown renderer — i.e. as an AI suggestion, which calls
renderComposerMarkdown(element, text). Minimal standalone repro (Node + jsdom, run from the repo root):import { JSDOM } from "jsdom"; const dom = new JSDOM(`<!DOCTYPE html><body></body>`); global.document = dom.window.document; global.NodeFilter = dom.window.NodeFilter; global.window = dom.window; const { renderComposerMarkdown } = await import( "./packages/react/src/lib/contentEditableComposer.js" ); const el = document.createElement("div"); renderComposerMarkdown(el, "my_file_name.js"); console.log(el.innerHTML); -
Observe the emitted HTML.
Expected behavior:
Underscores/asterisks inside a word should not be treated as emphasis. my_file_name.js should render literally as my_file_name.js (matching CommonMark, where emphasis delimiters must be left/right-flanking, i.e. at word boundaries).
Actual behavior:
Intra-word markers are parsed as emphasis:
| Input | Rendered HTML |
|---|---|
my_file_name.js |
my<em>file</em>name.js |
__init__ |
<strong>init</strong> |
call foo_bar_baz() now |
call foo<em>bar</em>baz() now |
2 * 3 * 4 = 24 |
2 <em> 3 </em> 4 = 24 |
Searched before filing: open + closed issues for "composer markdown formatting", "italic bold asterisk", and "underscore". The closest existing issue is #1315 (parseEmoji converts only the last emoji shortname) — a different function, but the same class of hand-rolled inline-text parser producing wrong output. This composer intra-word emphasis case does not appear to be tracked yet.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 171
- Forks
- 421
- Ø Merge
- 3 T. 6 Std.
- Gemergte PRs (30 T.)
- 4
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus RocketChat/EmbeddedChat
-
Bug: username fallback in updateUserUsername never runs since the ddp-client migrationEvtl. vergeben @MuhammadFaizan-prog hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
RocketChat/EmbeddedChat#1489 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: Low contrast on color swatch borders in Theme Lab (Layout Editor)Evtl. vergeben @yashsarvaiya45 hat das heute übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
RocketChat/EmbeddedChat#1486 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug(api): _doConnect swallows connection/auth errors and marks failed sessions as authenticatedEvtl. vergeben @ashwanisingh011 hat das vor 1 Tag übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
RocketChat/EmbeddedChat#1484 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug: White screen crash (`Cannot read properties of undefined (reading 'members')`) when rendering UserMention outside MarkupInteractionContextEvtl. vergeben @swarnendusahu10-dotcom hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
RocketChat/EmbeddedChat#1482 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug: UIKit PreviewBlock cover image tiles repeatedly and stretches across viewport when zoomed outEvtl. vergeben @swarnendusahu10-dotcom hat das vor 3 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
RocketChat/EmbeddedChat#1480 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in RocketChat/EmbeddedChat
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Life-Framework/Life-Framework#7017 ·
Maintainer antworten meist innerhalb von 1 Tag
-
e/DevOps enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Accenture/sfmc-devtools#2795 ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent/guide documentation help wanted stage/010-actionable
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
kubestellar/console-kb#4003 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
FilOzone/synapse-sdk#1201 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag