chore(editor): satisfy raw destination lint

This commit is contained in:
Neil
2026-09-18 05:16:45 -07:00
parent 7bdaa7056e
commit b44a5b8d9e
@@ -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