diff options
author | bobzel <zzzman@gmail.com> | 2024-10-28 20:08:35 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-10-28 20:08:35 -0400 |
commit | c45e21a8960298b77c3508b047cfbd9fdcf2c602 (patch) | |
tree | a0fabfd203267963e7a8a648ac01793b08bbdcf4 /src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts | |
parent | 8ac260db2fdffc37ff9b6e91971f287df6a70528 (diff) | |
parent | 63f9f9573dab9745d2f570e1917b325a474fdd93 (diff) |
Merge branch 'master' into alyssa-starter
Diffstat (limited to 'src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts')
-rw-r--r-- | src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts b/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts index 7a8b72be0..3c84e5a10 100644 --- a/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts +++ b/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts @@ -349,7 +349,9 @@ export function buildKeymap<S extends Schema<any>>(schema: S, props: any): KeyMa dispatch(tx4); } - if (view.state.selection.$anchor.nodeAfter?.type === schema.nodes.text && once) { + if (view.state.selection.$anchor.depth > 0 && + view.state.selection.$anchor.node(view.state.selection.$anchor.depth-1).type === schema.nodes.list_item && + view.state.selection.$anchor.nodeAfter?.type === schema.nodes.text && once) { // if text is selected across list items, then we need to forcibly insert a new line since the splitBlock code joins the two list items. enter(view.state, dispatch, view, false); } |