Skip to content

Commit

Permalink
Fix(frontend): オートコンプリートが出るべき状況で出ないことがあるのを修正 (#13376)
Browse files Browse the repository at this point in the history
* オートコンプリートが出るべき状況で出ないことがあるのを修正

* update CHANGELOG.md
  • Loading branch information
1Step621 authored Feb 18, 2024
1 parent 1b1046b commit 034f472
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
### Server
- Fix: nodeinfoにenableMcaptchaとenableTurnstileが無いのを修正

## 202x.x.x (unreleased)

### Client
- Fix: MFMのオートコンプリートが出るべき状況で出ないことがある問題を修正

## 2024.2.0

### Note
Expand Down
4 changes: 3 additions & 1 deletion packages/frontend/src/scripts/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ export class Autocomplete {
return;
}

const afterLastMfmParam = text.split(/\$\[[a-zA-Z]+/).pop();

const isMention = mentionIndex !== -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 isEmoji = emojiIndex !== -1 && text.split(/:[a-z0-9_+\-]+:/).pop()!.includes(':');

Expand Down

0 comments on commit 034f472

Please sign in to comment.