Skip to content

Commit

Permalink
オートコンプリートが出るべき状況で出ないことがあるのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
1STEP621 committed Feb 18, 2024
1 parent 8c1a582 commit f90a200
Showing 1 changed file with 3 additions and 1 deletion.
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 f90a200

Please sign in to comment.