mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 11:49:02 +08:00
fix bug
This commit is contained in:
parent
54195d29eb
commit
f7153cfe66
@ -58,7 +58,7 @@ const Link = createMark({
|
|||||||
|
|
||||||
addCommands() {
|
addCommands() {
|
||||||
return {
|
return {
|
||||||
link: (options: { href?: string, target?: string }): Command => ({ commands }) => {
|
link: (options: { href?: string, target?: string } = {}): Command => ({ commands }) => {
|
||||||
if (!options.href) {
|
if (!options.href) {
|
||||||
return commands.removeMark('link')
|
return commands.removeMark('link')
|
||||||
}
|
}
|
||||||
@ -68,12 +68,6 @@ const Link = createMark({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addKeyboardShortcuts() {
|
|
||||||
return {
|
|
||||||
'Mod-i': () => this.editor.italic(),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
addPasteRules() {
|
addPasteRules() {
|
||||||
return [
|
return [
|
||||||
markPasteRule(pasteRegex, this.type, (url: string) => ({ href: url })),
|
markPasteRule(pasteRegex, this.type, (url: string) => ({ href: url })),
|
||||||
|
Loading…
Reference in New Issue
Block a user