diff --git a/src/tiptap.js b/src/tiptap.js index 8657f69..c6315a5 100644 --- a/src/tiptap.js +++ b/src/tiptap.js @@ -80,6 +80,12 @@ export default Base.extend({ (await import("@tiptap/extension-hard-break")).default.configure(), // Gapcursor for images, tables etc to be able to add content below/above. (await import("@tiptap/extension-gapcursor")).Gapcursor.configure(), + // Always include basic link extension. + (await import("./extensions/link")).factory().configure({ + HTMLAttributes: { target: null, rel: null }, // don't set these attributes. + openOnClick: false, // don't open documents while editing. + linkOnPaste: true, + }), ]; const placeholder = this.el.getAttribute("placeholder"); if (placeholder) { diff --git a/src/toolbar.js b/src/toolbar.js index 59b28a3..3c5b642 100644 --- a/src/toolbar.js +++ b/src/toolbar.js @@ -157,16 +157,6 @@ export async function init_extensions({ app }) { extensions.push((await import("@tiptap/extension-history")).History); } - if (tb.link) { - extensions.push( - (await import("./extensions/link")).factory().configure({ - HTMLAttributes: { target: null, rel: null }, // don't set these attributes. - openOnClick: false, // don't open documents while editing. - linkOnPaste: true, - }) - ); - } - if (tb.image) { extensions.push((await import("./extensions/image-inline")).factory()); extensions.push((await import("./extensions/image-figure")).factory());