add keepOnSplit option to attributes

This commit is contained in:
Philipp Kühn
2021-01-28 19:56:35 +01:00
parent cde0d8690a
commit ee7daa3f43
5 changed files with 39 additions and 19 deletions

View File

@@ -59,14 +59,14 @@ export const TextAlign = Extension.create({
return {
// TODO: re-use only 'textAlign' attribute
// TODO: use custom splitBlock only for `this.options.types`
Enter: () => this.editor.commands.first(({ commands }) => [
() => commands.newlineInCode(),
() => commands.createParagraphNear(),
() => commands.liftEmptyBlock(),
() => commands.splitBlock({
withAttributes: true,
}),
]),
// Enter: () => this.editor.commands.first(({ commands }) => [
// () => commands.newlineInCode(),
// () => commands.createParagraphNear(),
// () => commands.liftEmptyBlock(),
// () => commands.splitBlock({
// withAttributes: true,
// }),
// ]),
'Mod-Shift-l': () => this.editor.commands.setTextAlign('left'),
'Mod-Shift-e': () => this.editor.commands.setTextAlign('center'),
'Mod-Shift-r': () => this.editor.commands.setTextAlign('right'),