fix: prompt-editor

This commit is contained in:
StyleZhang 2024-04-03 12:30:56 +08:00
parent d48bdf3e14
commit 459b690416
1 changed files with 2 additions and 2 deletions

View File

@ -158,9 +158,9 @@ export function useBasicTypeaheadTriggerMatch(
): TriggerFn {
return useCallback(
(text: string) => {
const validChars = `[^${trigger}${PUNCTUATION}\\s]`
const validChars = `[${PUNCTUATION}\\s]`
const TypeaheadTriggerRegex = new RegExp(
`([^${trigger}]|^)(`
'(.*)('
+ `[${trigger}]`
+ `((?:${validChars}){0,${maxLength}})`
+ ')$',