Nested inline code, emoji and mentions disappear inside bold, italic and strikethrough

Aperta Adatta ai principianti
#1,429 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
frontend

Direzione di ricerca

Inizia nel pacchetto markups in BoldSpan.js, ItalicSpan.js e StrikeSpan.js; leggi come ciascuno mappa i tipi di figli AST e dove restituisce null per i figli non gestiti. Riproduci con l’output del parser per *run yarn build first*, poi aggiungi i casi mancanti INLINE_CODE, EMOJI e MENTION, più i timestamp in StrikeSpan.js, con test di regressione. Fatto significa che il contenuto annidato viene renderizzato e che i test di markup esistenti passano; i link dentro italic/strikethrough e i crash di nested-emphasis sono fuori ambito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Description

Nested inline code, emoji and mentions are silently dropped by the markup renderer inside bold, italic and strikethrough.

For example, this message:

*run `yarn build` first*

renders as "run first", with the inline code missing.

Steps to reproduce

  1. Use EmbeddedChat develop at commit 1cb7bb38.
  2. Parse the example above using @rocket.chat/message-parser 0.31.29.
  3. Render the resulting AST through the markups package.
  4. Observe that the parser includes an INLINE_CODE child inside BOLD, but the rendered output drops it.

I also reproduced missing inline code, emoji and mentions inside italic and strikethrough using a local rendering harness.

Expected behaviour

Supported nested inline content should remain visible inside the formatting wrapper.

Environment

  • EmbeddedChat: develop at 1cb7bb38
  • Node.js: 24.0.0
  • Yarn: 3.6.4
  • @rocket.chat/message-parser: 0.31.29

Additional context

BoldSpan.js, ItalicSpan.js and StrikeSpan.js return null for child types they do not explicitly handle.

I have a local fix with regression tests for inline code, emoji and mentions inside these wrappers, plus timestamps inside strikethrough. Links inside italic/strikethrough and the pre-existing CommonJS nested-emphasis crashes remain outside this fix.

Related PRs #1044 and #1139 overlap with some files but address different behaviour.

Verification so far uses local package rendering, not a live Rocket.Chat server or the real chat UI.

Is this a fix you'd welcome a PR for?

Lingua principale
JavaScript
Stelle
170
Fork
397
Merge medio
12g 14h
PR unite (30g)
6

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RocketChat/EmbeddedChat

Tutte le issue di RocketChat/EmbeddedChat

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.