Emojiが違う場所に挿入される

なるほど、これで修正できます。

diff --git a/frontend/discourse/app/modifiers/d-autocomplete.js b/frontend/discourse/app/modifiers/d-autocomplete.js
index e49fc0ec53..33fb51a1f4 100644
--- a/frontend/discourse/app/modifiers/d-autocomplete.js
+++ b/frontend/discourse/app/modifiers/d-autocomplete.js
@@ -599,10 +599,19 @@ export default class DAutocompleteModifier extends Modifier {
         prev = this.getValue()[caretPos - 1];
         const shouldTrigger = await this.shouldTrigger({ backSpace });
 
-        if (
-          shouldTrigger &&
-          (prev === undefined || this.ALLOWED_LETTERS_REGEXP.test(prev))
-        ) {
+        // 絵文字のオートコンプリート(キー === ':')の場合、コンマ、ピリオドなど、絵文字の前に表示される可能性のある一般的な句読点を含む、より寛容なチェックを使用します
+        let isAllowed;
+        if (this.options.key === ":") {
+          // 絵文字オートコンプリートの onKeyUp 正規表現で許可されているのと同じ文字に一致します
+          isAllowed =
+            prev === undefined || /[\\s.?,@/#!%\u0026*;:\\[\\]{}=\\-_()+]/.test(prev);
+        } else {
+          isAllowed =
+            prev === undefined || this.ALLOWED_LETTERS_REGEXP.test(prev);
+        }
+
+        if (shouldTrigger && isAllowed) {
           start = caretPos;
           term = this.getValue().substring(caretPos + 1, initialCaretPos);
           end = caretPos + term.length;

@kelv このコードがどのように進化してきたのかあまり詳しくないのですが、最近行ったポートの一部で何か思い当たることはありますか?

「いいね!」 2