diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-12-10 23:27:55 -0500 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-12-10 23:27:55 -0500 |
commit | 921554d7d585a1138c7cf8d02d1e46f47c7cafe7 (patch) | |
tree | bf462a91db4282e5c0f7d8184317f3c28f7b827c /src/client/util/RichTextRules.ts | |
parent | 8a5b1332ec6c01b7caf14355e76980ab7afe71ba (diff) |
added indenting for ordered lists
Diffstat (limited to 'src/client/util/RichTextRules.ts')
-rw-r--r-- | src/client/util/RichTextRules.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/util/RichTextRules.ts b/src/client/util/RichTextRules.ts index c69112b3b..ba2bc785d 100644 --- a/src/client/util/RichTextRules.ts +++ b/src/client/util/RichTextRules.ts @@ -149,6 +149,10 @@ export const inpRules = { (state, match, start, end) => { if (state.selection.to === state.selection.from) return null; const pos = (state.doc.resolve(start) as any); + if (state.selection instanceof NodeSelection && (state.selection as NodeSelection).node.type === schema.nodes.ordered_list) { + let node = (state.selection as NodeSelection).node; + return state.tr.setNodeMarkup(pos.pos, node.type, { ...node.attrs, indent: 30 }); + } let depth = pos.path.length / 3 - 1; for (; depth >= 0; depth--) { if (pos.node(depth).type === schema.nodes.paragraph) { |