Fix(frontend): オートコンプリートが出るべき状況で出ないことがあるのを修正 (#13376)

* オートコンプリートが出るべき状況で出ないことがあるのを修正

* update CHANGELOG.md
This commit is contained in:
1Step621 2024-02-19 08:36:06 +09:00 committed by GitHub
parent 1b1046bcdb
commit 034f47205e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -30,6 +30,11 @@
### Server ### Server
- Fix: nodeinfoにenableMcaptchaとenableTurnstileが無いのを修正 - Fix: nodeinfoにenableMcaptchaとenableTurnstileが無いのを修正
## 202x.x.x (unreleased)
### Client
- Fix: MFMのオートコンプリートが出るべき状況で出ないことがある問題を修正
## 2024.2.0 ## 2024.2.0
### Note ### Note

View File

@ -93,9 +93,11 @@ export class Autocomplete {
return; return;
} }
const afterLastMfmParam = text.split(/\$\[[a-zA-Z]+/).pop();
const isMention = mentionIndex !== -1; const isMention = mentionIndex !== -1;
const isHashtag = hashtagIndex !== -1; const isHashtag = hashtagIndex !== -1;
const isMfmParam = mfmParamIndex !== -1 && text.split(/\$\[[a-zA-Z]+/).pop()?.includes('.'); const isMfmParam = mfmParamIndex !== -1 && afterLastMfmParam?.includes('.') && !afterLastMfmParam?.includes(' ');
const isMfmTag = mfmTagIndex !== -1 && !isMfmParam; const isMfmTag = mfmTagIndex !== -1 && !isMfmParam;
const isEmoji = emojiIndex !== -1 && text.split(/:[a-z0-9_+\-]+:/).pop()!.includes(':'); const isEmoji = emojiIndex !== -1 && text.split(/:[a-z0-9_+\-]+:/).pop()!.includes(':');