diff --git a/packages/extension-link/src/helpers/autolink.ts b/packages/extension-link/src/helpers/autolink.ts index a6ef08d85..90b2fdd0d 100644 --- a/packages/extension-link/src/helpers/autolink.ts +++ b/packages/extension-link/src/helpers/autolink.ts @@ -87,7 +87,10 @@ 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 + if (!newState.schema.marks.code) { + return true + } + return !newState.doc.rangeHasMark( link.from, link.to,