improve textAlign behavior within lists, see #72
This commit is contained in:
@@ -59,10 +59,14 @@ export const TextAlign = Extension.create({
|
|||||||
return {
|
return {
|
||||||
// TODO: re-use only 'textAlign' attribute
|
// TODO: re-use only 'textAlign' attribute
|
||||||
// TODO: use custom splitBlock only for `this.options.types`
|
// TODO: use custom splitBlock only for `this.options.types`
|
||||||
// TODO: use complete default enter handler (chainCommand) with custom splitBlock
|
Enter: () => this.editor.commands.first(({ commands }) => [
|
||||||
Enter: () => this.editor.commands.splitBlock({
|
() => commands.newlineInCode(),
|
||||||
|
() => commands.createParagraphNear(),
|
||||||
|
() => commands.liftEmptyBlock(),
|
||||||
|
() => commands.splitBlock({
|
||||||
withAttributes: true,
|
withAttributes: true,
|
||||||
}),
|
}),
|
||||||
|
]),
|
||||||
'Mod-Shift-l': () => this.editor.commands.setTextAlign('left'),
|
'Mod-Shift-l': () => this.editor.commands.setTextAlign('left'),
|
||||||
'Mod-Shift-e': () => this.editor.commands.setTextAlign('center'),
|
'Mod-Shift-e': () => this.editor.commands.setTextAlign('center'),
|
||||||
'Mod-Shift-r': () => this.editor.commands.setTextAlign('right'),
|
'Mod-Shift-r': () => this.editor.commands.setTextAlign('right'),
|
||||||
|
|||||||
Reference in New Issue
Block a user