Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

editor: fix n.startsWith is not a function

Ammar Ahmed0e8a5ca1fa3c
diff --git a/packages/editor/src/extensions/link/link.ts b/packages/editor/src/extensions/link/link.ts
index 2f58a9f74..5a9f7570a 100644
--- a/packages/editor/src/extensions/link/link.ts
+++ b/packages/editor/src/extensions/link/link.ts
@@ -166,7 +166,7 @@ export const Link = Mark.create<LinkOptions>({
renderHTML({ HTMLAttributes }) {
// False positive; we're explicitly checking for javascript: links to ignore them
- if (HTMLAttributes.href?.startsWith("javascript:")) {
+ if (HTMLAttributes.href?.startsWith?.("javascript:")) {
// strip out the href
return [
"a",