From f3fa3a0a9107b3733b4f21547b32c5816a0fa74d Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Wed, 12 Jan 2022 23:58:36 +0100 Subject: [PATCH] Problem: first line of pasted text is not saved Solution: change regex of input string split --- list-editor/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list-editor/index.js b/list-editor/index.js index 9fb6a52..1cc721f 100644 --- a/list-editor/index.js +++ b/list-editor/index.js @@ -527,7 +527,7 @@ function editor(root, inputData, options) { if (inputString.match(/^- /)) { let item = $(this).parents('.list-item') let id = item.attr('data-id') - let lines = inputString.split(/^|\n( *)- /) + let lines = inputString.split(/^( *)- /ms) lines.shift() const firstItem = store.value(id) const firstIndent = firstItem.indented