Skip to content

Commit

Permalink
fix: check for firstMatch before using
Browse files Browse the repository at this point in the history
  • Loading branch information
Wattenberger committed Aug 30, 2022
1 parent ef94a37 commit d1ebf2f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions blocks/file-blocks/markdown-edit/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export function makeExtensions({
return -1;
const hasIncludedLink = match[0].indexOf("](http") !== -1;
if (hasIncludedLink) return -1;
if (!firstMatch) return -1;
return cx.addElement(
cx.elt("URL", start, start + 1 + firstMatch.length)
);
Expand Down

0 comments on commit d1ebf2f

Please sign in to comment.