refactoring

This commit is contained in:
Philipp Kühn
2021-02-10 18:05:02 +01:00
parent f70974678b
commit 55ff908423
69 changed files with 519 additions and 527 deletions

View File

@@ -14,8 +14,17 @@ export interface CodeOptions {
declare module '@tiptap/core' {
interface Commands {
/**
* Set a code mark
*/
setCode: () => Command,
/**
* Toggle inline code
*/
toggleCode: () => Command,
/**
* Unset a code mark
*/
unsetCode: () => Command,
}
}
@@ -44,21 +53,12 @@ export const Code = Mark.create({
addCommands() {
return {
/**
* Set a code mark
*/
setCode: () => ({ commands }) => {
return commands.setMark('code')
},
/**
* Toggle inline code
*/
toggleCode: () => ({ commands }) => {
return commands.toggleMark('code')
},
/**
* Unset a code mark
*/
unsetCode: () => ({ commands }) => {
return commands.unsetMark('code')
},