Skip to content

Commit

Permalink
Fix Uncaught TypeError: (...) unsetLink is not a function
Browse files Browse the repository at this point in the history
Include existing commands when extending a single command. For example, see
similar example here:

https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing#extend-existing-attributes

The full error is:

  TypeError: ctx.editor?.chain(...).focus(...).extendMarkRange(...).unsetLink is not a function
  • Loading branch information
luca-vari committed Oct 31, 2024
1 parent 83ffcc7 commit 2174789
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MultiToken, tokenize } from 'linkifyjs'
export const CustomLink = Link.extend({
addCommands() {
return {
...this.parent?.(),
/* The tiptap link extension uses a default protocol if a link is
* entered without a protocol. This does not happen for links entered
* via the mantine RichTextEditor.Link component (we use in this in
Expand Down

0 comments on commit 2174789

Please sign in to comment.