Skip to content

Commit

Permalink
fix(markpasterule): parent is undefined for mark
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjbrown committed May 4, 2020
1 parent 92eb2c6 commit 463fd91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/tiptap-commands/src/commands/markPasteRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 463fd91

Please sign in to comment.