diff --git a/examples/Components/Routes/Links/index.vue b/examples/Components/Routes/Links/index.vue index 6de03c79..2f5d342d 100644 --- a/examples/Components/Routes/Links/index.vue +++ b/examples/Components/Routes/Links/index.vue @@ -71,10 +71,10 @@ export default { new OrderedList(), new TodoItem(), new TodoList(), + new Link(), new Bold(), new Code(), new Italic(), - new Link(), new History(), ], content: ` diff --git a/packages/tiptap-commands/src/commands/markPasteRule.js b/packages/tiptap-commands/src/commands/markPasteRule.js index 009ae013..363f4d2c 100644 --- a/packages/tiptap-commands/src/commands/markPasteRule.js +++ b/packages/tiptap-commands/src/commands/markPasteRule.js @@ -8,12 +8,14 @@ export default function (regexp, type, getAttrs) { fragment.forEach(child => { if (child.isText) { - const { text } = child + const { text, marks } = child let pos = 0 let match + const isLink = !!marks.filter(x => x.type.name === 'link')[0] + // eslint-disable-next-line - while ((match = regexp.exec(text)) !== null) { + while (!isLink && (match = regexp.exec(text)) !== null) { if (match[1]) { const start = match.index const end = start + match[0].length