mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 19:59:02 +08:00
improve textAlign behavior within lists, see #72
This commit is contained in:
parent
5e29cc1481
commit
43dc14b9fc
@ -59,10 +59,14 @@ export const TextAlign = Extension.create({
|
||||
return {
|
||||
// TODO: re-use only 'textAlign' attribute
|
||||
// TODO: use custom splitBlock only for `this.options.types`
|
||||
// TODO: use complete default enter handler (chainCommand) with custom splitBlock
|
||||
Enter: () => this.editor.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'),
|
||||
|
Loading…
Reference in New Issue
Block a user