Skip to content

Commit 034f472

Browse files
authored
Fix(frontend): オートコンプリートが出るべき状況で出ないことがあるのを修正 (#13376)
* オートコンプリートが出るべき状況で出ないことがあるのを修正 * update CHANGELOG.md
1 parent 1b1046b commit 034f472

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
### Server
3131
- Fix: nodeinfoにenableMcaptchaとenableTurnstileが無いのを修正
3232

33+
## 202x.x.x (unreleased)
34+
35+
### Client
36+
- Fix: MFMのオートコンプリートが出るべき状況で出ないことがある問題を修正
37+
3338
## 2024.2.0
3439

3540
### Note

packages/frontend/src/scripts/autocomplete.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@ export class Autocomplete {
9393
return;
9494
}
9595

96+
const afterLastMfmParam = text.split(/\$\[[a-zA-Z]+/).pop();
97+
9698
const isMention = mentionIndex !== -1;
9799
const isHashtag = hashtagIndex !== -1;
98-
const isMfmParam = mfmParamIndex !== -1 && text.split(/\$\[[a-zA-Z]+/).pop()?.includes('.');
100+
const isMfmParam = mfmParamIndex !== -1 && afterLastMfmParam?.includes('.') && !afterLastMfmParam?.includes(' ');
99101
const isMfmTag = mfmTagIndex !== -1 && !isMfmParam;
100102
const isEmoji = emojiIndex !== -1 && text.split(/:[a-z0-9_+\-]+:/).pop()!.includes(':');
101103

0 commit comments

Comments
 (0)