From 1ff049ce2fdf207c303f9f30c8a9b2b3936a737a Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 9 Jan 2024 14:25:51 +0100 Subject: [PATCH] refactor(RichText): remove option to disable Link extension This option is not used anyway. We always use the Link extension. Signed-off-by: Jonas --- src/extensions/RichText.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/extensions/RichText.js b/src/extensions/RichText.js index 2e714921ad8..d3bb572a6af 100644 --- a/src/extensions/RichText.js +++ b/src/extensions/RichText.js @@ -114,6 +114,12 @@ export default Extension.create({ suggestion: EmojiSuggestion(), }), LinkPicker, + Link.configure({ + ...this.options.link, + openOnClick: true, + validate: href => /^https?:\/\//.test(href), + relativePath: this.options.relativePath, + }), LinkBubble, this.options.editing ? Placeholder.configure({ @@ -124,14 +130,6 @@ export default Extension.create({ : null, TrailingNode, ] - if (this.options.link !== false) { - defaultExtensions.push(Link.configure({ - ...this.options.link, - openOnClick: true, - validate: href => /^https?:\/\//.test(href), - relativePath: this.options.relativePath, - })) - } const additionalExtensionNames = this.options.extensions.map(e => e.name) return [ ...defaultExtensions.filter(e => e && !additionalExtensionNames.includes(e.name)),