feat: Double-link: Search interaction

This commit is contained in:
xiaodong zuo
2022-08-24 15:26:27 +08:00
parent 7d35303395
commit 9169421460
7 changed files with 77 additions and 68 deletions
@@ -192,9 +192,10 @@ export const DoubleLinkMenu = ({
anchorNode.id !== curBlockId &&
editor.blockHelper.isSelectionCollapsed(anchorNode.id))
) {
const text = editor.blockHelper.getBlockTextBeforeSelection(
anchorNode.id
);
const text =
editor.blockHelper.getBlockTextBeforeSelection(
anchorNode.id
) || '';
if (text.endsWith('[[')) {
resetState(curBlockId, anchorNode.id);
}