diff --git a/packages/core/src/pasteRules/markPasteRule.ts b/packages/core/src/pasteRules/markPasteRule.ts index 74bdbe98..361d464d 100644 --- a/packages/core/src/pasteRules/markPasteRule.ts +++ b/packages/core/src/pasteRules/markPasteRule.ts @@ -16,7 +16,7 @@ export default function (regexp: RegExp, type: MarkType, getAttrs?: (match: any) const outerMatch = Math.max(match.length - 2, 0) const innerMatch = Math.max(match.length - 1, 0) - if (parent.type.allowsMarkType(type)) { + if (parent?.type.allowsMarkType(type)) { const start = match.index const matchStart = start + match[0].indexOf(match[outerMatch]) const matchEnd = matchStart + match[outerMatch].length