fix: normalize Unicode characters in paste modal for proper detection (#976)

This commit is contained in:
Nitish Agarwal 2025-11-17 14:45:03 +05:30 committed by GitHub
parent b074462ee7
commit e293edb069
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -66,7 +66,8 @@ export default function PasteModal() {
const macroSteps: MacroStep[] = [];
for (const char of text) {
const keyprops = selectedKeyboard.chars[char];
const normalizedChar = char.normalize('NFC');
const keyprops = selectedKeyboard.chars[normalizedChar];
if (!keyprops) continue;
const { key, shift, altRight, deadKey, accentKey } = keyprops;
@ -164,7 +165,7 @@ export default function PasteModal() {
...new Set(
// @ts-expect-error TS doesn't recognize Intl.Segmenter in some environments
[...new Intl.Segmenter().segment(value)]
.map(x => x.segment)
.map(x => x.segment.normalize('NFC'))
.filter(char => !selectedKeyboard.chars[char]),
),
];