Skip to content

Commit

Permalink
refactor(RichText): remove option to disable Link extension
Browse files Browse the repository at this point in the history
This option is not used anyway. We always use the Link extension.

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Jan 25, 2024
1 parent 67b146b commit 1ff049c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/extensions/RichText.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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)),
Expand Down

0 comments on commit 1ff049c

Please sign in to comment.