aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-09-15 22:18:37 -0400
committerbobzel <zzzman@gmail.com>2020-09-15 22:18:37 -0400
commitd11bee7e5e25240d37827c5369e45e551d22eafe (patch)
treec322082b5df676261fa87f68eb520403732f7185 /src
parent4913f4a75ea49463875a9398a20701bc1e4d4d37 (diff)
fixed error on carriage return in empty text note
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts b/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts
index f1a0188c5..cb5823e86 100644
--- a/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts
+++ b/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts
@@ -217,13 +217,13 @@ export function buildKeymap<S extends Schema<any>>(schema: S, props: any, mapKey
const fromattrs = state.selection.$from.node().attrs;
if (!splitBlockKeepMarks(state, (tx3: Transaction) => {
const tonode = tx3.selection.$to.node();
- if (tx3.doc.nodeAt(tx3.selection.to - 1)) {
+ if (tx3.selection.to && tx3.doc.nodeAt(tx3.selection.to - 1)) {
const tx4 = tx3.setNodeMarkup(tx3.selection.to - 1, tonode.type, fromattrs, tonode.marks);
splitMetadata(marks, tx4);
if (!liftListItem(schema.nodes.list_item)(tx4, dispatch as ((tx: Transaction<Schema<any, any>>) => void))) {
dispatch(tx4);
}
- } else dispatch(tx3.insertText("\r"));
+ } else dispatch(tx3.insertText("\r\n"));
})) {
return false;
}