fix(message-parser): inline keycap emojis starting with digits parse as plain text
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, typescript
Direzione di ricerca
Read packages/message-parser/src/grammar.pegjs around InlineItemPattern, the digit dispatch paths, and InlineEmoji; then review the existing emoji cases in packages/message-parser/tests/emoji.test.ts. Add inline keycap cases for 1️⃣, 0️⃣, and 8️⃣ and confirm they produce emoji nodes, while plain text still parses. Pull request #44033 is already open against this issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
In packages/message-parser/src/grammar.pegjs, the first-character dispatch in InlineItemPattern routes digits 0/8 to InlineItemAlphaOrEmoticon and 1-7/9 to InlineItemAlphaPath. Neither of these rules tries InlineEmoji before PlainRun, and PlainRun does not exclude digits or keycap combining characters (\uFE0F, \u20E3). As a result, PlainRun consumes inline keycap sequences such as 1️⃣, 0️⃣, or 8️⃣ as plain text before InlineEmoji (and UnicodeEmojiKeycapSequence) can match.
Standalone keycap messages (e.g., "1️⃣") still pass because BigEmoji runs before Inline, so existing tests in packages/message-parser/tests/emoji.test.ts do not catch this inline regression.
Steps to Reproduce
- Import
parsefrom@rocket.chat/message-parser. - Call
parse('pick 1️⃣ now')(orparse('pick 0️⃣ now')/parse('pick 8️⃣ now')). - Inspect the returned AST
Paragraphchildren. - Observe that
1️⃣is emitted inside aPLAINnode instead of anEMOJInode.
Expected Behavior
parse('pick 1️⃣ now') should return a Paragraph containing:
plain('pick ')emojiUnicode('1️⃣')plain(' now')
Actual Behavior / Error Logs
// Actual AST output for parse('pick 1️⃣ now'):
// InlineItemPattern matches & [a-zA-Z1-79] -> InlineItemAlphaPath -> PlainRun
// PlainRun = run:$[^*_~`:\n<\[\]! \t\u00a0()\\|]+
// Consumes "1️⃣" as plain text instead of matching UnicodeEmojiKeycapSequence
[
{
type: 'PARAGRAPH',
value: [
{ type: 'PLAIN_TEXT', value: 'pick 1️⃣ now' }
]
}
]
Proposed Fix
Update packages/message-parser/src/grammar.pegjs so digit-starting inline inputs attempt InlineEmoji (or UnicodeEmojiKeycapSequence) before PlainRun:
- Route
[08]and[1-79](or addInlineEmojibeforePlainRunon the digit dispatch paths /InlineItemDigitPathandInlineItemAlphaOrEmoticonfor0/8) so1️⃣–9️⃣and0️⃣matchInlineEmojibefore falling back toPlainRun. - Add inline keycap regression test cases (e.g.,
'pick 1️⃣ now','pick 0️⃣ now','pick 8️⃣ now') topackages/message-parser/tests/emoji.test.ts.
- Lingua principale
- TypeScript
- Stelle
- 46.6k
- Fork
- 14.2k
- Merge medio
- 2g 21h
- PR unite (30g)
- 302
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di RocketChat/Rocket.Chat
-
ModerationConsoleTable renders blank area instead of error state when query failsForse già presa @Siddharth-singh18 l’ha presa 2 giorni fa. Apertatype: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
RocketChat/Rocket.Chat#44109 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Composer clears message text when the first uploaded file's media confirmation failsForse già presa @Sravan-0802 l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
RocketChat/Rocket.Chat#44087 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Subsequent OAuth logins overwrite persisted service fields (e.g. refreshToken) with nullForse già presa @ayushbuilds-code l’ha presa 4 giorni fa. Apertatype: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
RocketChat/Rocket.Chat#44053 · 4 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Custom OAuth callback times out when Merge roles from SSO is enabledForse già presa @Pantkartik l’ha presa 6 giorni fa. Apertatype: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
RocketChat/Rocket.Chat#44005 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Heads-up: Issue Dedupe workflow pins claude-sonnet-4-5-20250929, which Anthropic retires Nov 30Forse già presa @Ravichandra531 l’ha presa 6 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
RocketChat/Rocket.Chat#43944 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di RocketChat/Rocket.Chat
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
zabuton-app/meguri#875 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
iruzen-dono/workless#117 ·
I maintainer di solito rispondono entro 1 giorno
-
area:api area:web wave wave:trivial
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
vetro-protocol/vetro-monorepo#1321 ·
I maintainer di solito rispondono entro 1 giorno