add new commands to all extensions
This commit is contained in:
@@ -32,8 +32,8 @@ export default class Bold extends Mark {
|
||||
}
|
||||
}
|
||||
|
||||
command({ type }) {
|
||||
return toggleMark(type)
|
||||
commands({ type }) {
|
||||
return () => toggleMark(type)
|
||||
}
|
||||
|
||||
inputRules({ type }) {
|
||||
|
||||
@@ -22,8 +22,8 @@ export default class Code extends Mark {
|
||||
}
|
||||
}
|
||||
|
||||
command({ type }) {
|
||||
return toggleMark(type)
|
||||
commands({ type }) {
|
||||
return () => toggleMark(type)
|
||||
}
|
||||
|
||||
inputRules({ type }) {
|
||||
|
||||
@@ -24,8 +24,8 @@ export default class Italic extends Mark {
|
||||
}
|
||||
}
|
||||
|
||||
command({ type }) {
|
||||
return toggleMark(type)
|
||||
commands({ type }) {
|
||||
return () => toggleMark(type)
|
||||
}
|
||||
|
||||
inputRules({ type }) {
|
||||
|
||||
@@ -30,12 +30,14 @@ export default class Link extends Mark {
|
||||
}
|
||||
}
|
||||
|
||||
command({ type, attrs }) {
|
||||
if (attrs.href) {
|
||||
return updateMark(type, attrs)
|
||||
}
|
||||
commands({ type }) {
|
||||
return attrs => {
|
||||
if (attrs.href) {
|
||||
return updateMark(type, attrs)
|
||||
}
|
||||
|
||||
return removeMark(type)
|
||||
return removeMark(type)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ export default class Strike extends Mark {
|
||||
}
|
||||
}
|
||||
|
||||
command({ type }) {
|
||||
return toggleMark(type)
|
||||
commands({ type }) {
|
||||
return () => toggleMark(type)
|
||||
}
|
||||
|
||||
inputRules({ type }) {
|
||||
|
||||
@@ -28,8 +28,8 @@ export default class Underline extends Mark {
|
||||
}
|
||||
}
|
||||
|
||||
command({ type }) {
|
||||
return toggleMark(type)
|
||||
commands({ type }) {
|
||||
return () => toggleMark(type)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user