From 6e87882820d8d933b8cb2e861be64906bdf68966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Thu, 18 Mar 2021 10:54:16 +0100 Subject: [PATCH] fix bug in markPasteRule, fix #215 --- packages/core/src/pasteRules/markPasteRule.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/pasteRules/markPasteRule.ts b/packages/core/src/pasteRules/markPasteRule.ts index 74bdbe98c..361d464df 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