add some more commands

This commit is contained in:
Philipp Kühn
2020-09-21 23:17:30 +02:00
parent 778e064979
commit 4da71ecfbb
27 changed files with 207 additions and 210 deletions

View File

@@ -13,15 +13,15 @@ export default new Node()
parseDOM: [{ tag: 'hr' }],
toDOM: () => ['hr'],
}))
.commands(({ editor, type }) => ({
horizontalRule: next => () => {
const { state, view } = editor
const { dispatch } = view
// .commands(({ editor, type }) => ({
// horizontalRule: next => () => {
// const { state, view } = editor
// const { dispatch } = view
dispatch(state.tr.replaceSelectionWith(type.create()))
next()
},
}))
// dispatch(state.tr.replaceSelectionWith(type.create()))
// next()
// },
// }))
.inputRules(({ type }) => [
nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/, type),
])