add new commands to all extensions

This commit is contained in:
Philipp Kühn
2018-10-28 21:59:08 +01:00
parent d2519c2953
commit dcba6686dc
16 changed files with 37 additions and 38 deletions

View File

@@ -32,8 +32,8 @@ export default class Bold extends Mark {
}
}
command({ type }) {
return toggleMark(type)
commands({ type }) {
return () => toggleMark(type)
}
inputRules({ type }) {

View File

@@ -22,8 +22,8 @@ export default class Code extends Mark {
}
}
command({ type }) {
return toggleMark(type)
commands({ type }) {
return () => toggleMark(type)
}
inputRules({ type }) {

View File

@@ -24,8 +24,8 @@ export default class Italic extends Mark {
}
}
command({ type }) {
return toggleMark(type)
commands({ type }) {
return () => toggleMark(type)
}
inputRules({ type }) {

View File

@@ -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)
}
}
}

View File

@@ -34,8 +34,8 @@ export default class Strike extends Mark {
}
}
command({ type }) {
return toggleMark(type)
commands({ type }) {
return () => toggleMark(type)
}
inputRules({ type }) {

View File

@@ -28,8 +28,8 @@ export default class Underline extends Mark {
}
}
command({ type }) {
return toggleMark(type)
commands({ type }) {
return () => toggleMark(type)
}
}