From d11bee7e5e25240d37827c5369e45e551d22eafe Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 15 Sep 2020 22:18:37 -0400 Subject: fixed error on carriage return in empty text note --- src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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>(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>) => void))) { dispatch(tx4); } - } else dispatch(tx3.insertText("\r")); + } else dispatch(tx3.insertText("\r\n")); })) { return false; } -- cgit v1.2.3-70-g09d2