File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/packages/frontend/editors/slate/slate-mentions Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -94,9 +94,9 @@ export const useMentions: (Options) => MentionsControl = ({
94
94
}
95
95
if ( Text . isText ( current ) ) {
96
96
const charBeforeCursor = current . text [ focus . offset - 1 ] ;
97
+ // keep use of this consistent with before stuff in frontend/editors/markdown-input/component.tsx
97
98
const charBeforeBefore = current . text [ focus . offset - 2 ] ?. trim ( ) ;
98
99
let afterMatch , beforeMatch , beforeRange , search ;
99
- // try to keep this consistent with before stuff in frontend/editors/markdown-input/component.tsx
100
100
if ( charBeforeCursor == "@" ) {
101
101
beforeRange = {
102
102
focus : editor . selection . focus ,
@@ -121,10 +121,11 @@ export const useMentions: (Options) => MentionsControl = ({
121
121
afterMatch = afterText . match ( / ^ ( \s | $ ) / ) ;
122
122
}
123
123
if (
124
- ( charBeforeCursor == "@" || ( beforeMatch && afterMatch ) ) &&
125
- ( ! charBeforeBefore ||
126
- charBeforeBefore == "(" ||
127
- charBeforeBefore == "[" )
124
+ ( charBeforeCursor == "@" &&
125
+ ( ! charBeforeBefore ||
126
+ charBeforeBefore == "(" ||
127
+ charBeforeBefore == "[" ) ) ||
128
+ ( beforeMatch && afterMatch )
128
129
) {
129
130
setTarget ( beforeRange ) ;
130
131
setSearch ( search ) ;
You can’t perform that action at this time.
0 commit comments