This commit is contained in:
Zef Hemel
2022-12-29 12:53:42 +01:00
parent a203f368c2
commit f78a0abbbe
2 changed files with 10 additions and 1 deletions
+4
View File
@@ -25,6 +25,10 @@ export function linkPlugin(editor: Editor) {
const text = state.sliceDoc(from, to);
// Links are of the form [hell](https://example.com)
const [anchorPart, linkPart] = text.split("]("); // Not pretty
if (anchorPart.substring(1).trim() === "") {
// Empty link text, let's not do live preview (because it would make it disappear)
return;
}
if (!linkPart) {
// Invalid link
return;