Improve emoji search (#39815)

This commit is contained in:
Echo authored and Tarrien committed 2026-08-14 07:23:43 -04:00
1 parent e0fd68866e
commit 11f28e1474
13 files changed
+652 -329

No files matched your search

@@ -10,6 +10,14 @@ describe('textAtCursorMatchesToken', () => {
['#hash tag', 8, ['#']],
[1, '#hash tag'],
],
[
[':+1', 2, [':']],
[1, ':+1'],
],
[
[':-1', 2, [':']],
[1, ':-1'],
],
[
['#ハッシュタグ', 6, ['#']],
[1, '#ハッシュタグ'],
@@ -8,7 +8,7 @@ export const textAtCursorMatchesToken = (
let word: string;
const regex = new RegExp(
`[${searchTokens.join('')}${WORD}]+(\\s[${WORD}]+)?$`,
`[${searchTokens.join('')}${WORD}+-]+(\\s[${WORD}]+)?$`,
'iu',
);
const left = str.slice(0, caretPosition).search(regex);