From 463fd91eba2cd445bfcd717dfb6251425dd90437 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Mon, 4 May 2020 16:36:36 +0200 Subject: [PATCH] fix(markpasterule): parent is undefined for mark --- packages/tiptap-commands/src/commands/markPasteRule.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tiptap-commands/src/commands/markPasteRule.js b/packages/tiptap-commands/src/commands/markPasteRule.js index e555fce0..383b0640 100644 --- a/packages/tiptap-commands/src/commands/markPasteRule.js +++ b/packages/tiptap-commands/src/commands/markPasteRule.js @@ -16,7 +16,7 @@ export default function (regexp, type, getAttrs) { // eslint-disable-next-line while (!isLink && (match = regexp.exec(text)) !== null) { - if (parent.type.allowsMarkType(type) && match[1]) { + if (parent && parent.type.allowsMarkType(type) && match[1]) { const start = match.index const end = start + match[0].length const textStart = start + match[0].indexOf(match[1])