From b44a5b8d9ea5925dbf00fa1ec9998d668bd4f4c9 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 18 Sep 2026 05:16:45 -0700 Subject: [PATCH] chore(editor): satisfy raw destination lint --- .../src/components/editor/rich-markdown-extensions.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/editor/rich-markdown-extensions.ts b/src/renderer/src/components/editor/rich-markdown-extensions.ts index 8879a83c426..e2e2c353633 100644 --- a/src/renderer/src/components/editor/rich-markdown-extensions.ts +++ b/src/renderer/src/components/editor/rich-markdown-extensions.ts @@ -71,10 +71,14 @@ const RichMarkdownLink = Link.extend({ }) function extractRawDestination(raw: string | undefined): string | null { - if (!raw) return null + if (!raw) { + return null + } const open = raw.indexOf('](') const close = raw.lastIndexOf(')') - if (open < 0 || close <= open + 2) return null + if (open === -1 || close <= open + 2) { + return null + } const destination = raw.slice(open + 2, close).trim() const titleStart = destination.search(/\s+["']|\s+\(/) return titleStart >= 0 ? destination.slice(0, titleStart) : destination