Skip to content

Commit 3017eca

Browse files
kumar-karanjuliusmarmingeclaude
authored
fix(shared): terminal labels after non-BMP letters stay plain text (pingdotgg#19968)
Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
1 parent 6cf704b commit 3017eca

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/shared/src/composerContextLegacy.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,12 @@ export function upgradeLegacyContextMessage(text: string): UpgradedLegacyContext
408408
if (placedTerminals.has(record)) continue;
409409
const label = inlineTerminalLabel(record);
410410
let at = body.indexOf(label);
411+
// Alternation instead of a character class: on Electron 44's V8 (15.2) a class
412+
// directly before `$` with the `u` flag never matches a code point outside the
413+
// BMP, so `𐐀@build:7` would become a chip (#18272).
411414
while (
412415
at !== -1 &&
413-
(/[\p{L}\p{N}\p{M}_@.-]$/u.test(body.slice(0, at)) ||
416+
(/(?:\p{L}|\p{N}|\p{M}|[_@.-])$/u.test(body.slice(0, at)) ||
414417
/^(?:[\p{L}\p{N}\p{M}_-]|[.@]+[\p{L}\p{N}\p{M}_-])/u.test(body.slice(at + label.length)))
415418
) {
416419
at = body.indexOf(label, at + 1);

0 commit comments

Comments
 (0)