diff --git a/packages/extension-link/src/helpers/autolink.ts b/packages/extension-link/src/helpers/autolink.ts index d85d01b49e6..a6ef08d8536 100644 --- a/packages/extension-link/src/helpers/autolink.ts +++ b/packages/extension-link/src/helpers/autolink.ts @@ -87,6 +87,7 @@ export function autolink(options: AutolinkOptions): Plugin { })) // ignore link inside code mark .filter(link => { + if (!newState.schema.marks.code) return true; // maybe code is not enabled for this editor return !newState.doc.rangeHasMark( link.from, link.to,