Skip to content

Commit 26e7225

Browse files
committed
fix: additional checks
1 parent 04d5ae9 commit 26e7225

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/web/EnrichedTextInput.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -397,23 +397,22 @@ export const EnrichedTextInput = ({
397397
toggleCheckboxList: (checked: boolean) =>
398398
runFocused(editor, (c) => c.toggleCheckboxList(checked)),
399399
setLink: (start: number, end: number, text: string, url: string) =>
400-
setLink(editor, start, end, text, url),
400+
runSafelyInEditor(editor, (e) => setLink(e, start, end, text, url)),
401401
removeLink: (start: number, end: number) =>
402-
removeLink(editor, start, end),
402+
runSafelyInEditor(editor, (e) => removeLink(e, start, end)),
403403
startMention: (indicator: string) => {
404-
startMention(editor, indicator, mentionIndicatorsRef.current);
404+
runSafelyInEditor(editor, (e) =>
405+
startMention(e, indicator, mentionIndicatorsRef.current)
406+
);
405407
},
406408
setMention: (
407409
indicator: string,
408410
text: string,
409411
attributes?: Record<string, string>
410412
) => {
411413
checkMentionAttributes(attributes);
412-
setMention(
413-
editor,
414-
indicator,
415-
text,
416-
sanitizeMentionAttributes(attributes)
414+
runSafelyInEditor(editor, (e) =>
415+
setMention(e, indicator, text, sanitizeMentionAttributes(attributes))
417416
);
418417
},
419418
setImage: (src: string, width: number, height: number) =>

0 commit comments

Comments
 (0)