Skip to content

Commit

Permalink
feat: Allways allow links (<a>) in tiptap.
Browse files Browse the repository at this point in the history
  • Loading branch information
thet committed Apr 21, 2022
1 parent 8041feb commit 8cfb5a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 6 additions & 0 deletions src/tiptap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 0 additions & 10 deletions src/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 8cfb5a4

Please sign in to comment.