Skip to content

Commit 6879142

Browse files
committed
fix: fix not fill the text when make a normal text to a link
1 parent 3bd560b commit 6879142

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/extensions/Link/components/LinkEditBlock.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ function LinkEditBlock(props: IPropsLinkEditBlock) {
3232
const LinkOptions = props.editor.extensionManager.extensions.find(
3333
(ext: any) => ext.name === Link.name,
3434
)?.options;
35+
const { from, to } = props.editor.state.selection;
36+
const text = props.editor.state.doc.textBetween(from, to, " ");
37+
setForm({ link: "", text });
3538
setOpenInNewTab(LinkOptions?.HTMLAttributes?.target === '_blank');
3639
}
3740
};

0 commit comments

Comments
 (0)