From f942a30293bebb5a4862156950057e6b12ebcee4 Mon Sep 17 00:00:00 2001 From: Petyo Ivanov Date: Sun, 7 Apr 2024 11:27:37 +0300 Subject: [PATCH] fix: empty title case Fixes #350 --- src/plugins/link-dialog/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/link-dialog/index.ts b/src/plugins/link-dialog/index.ts index d87a2b7a..d012ec9c 100644 --- a/src/plugins/link-dialog/index.ts +++ b/src/plugins/link-dialog/index.ts @@ -148,10 +148,10 @@ export const linkDialogState$ = Cell { - const url = payload.url.trim() - const title = payload.title.trim() + const url = payload.url?.trim() ?? '' + const title = payload.title?.trim() ?? '' - if (url.trim() !== '') { + if (url !== '') { if (selection?.isCollapsed()) { const linkContent = title || url editor?.update(