From d3cde5fd942ebd2aca3239fed6e6e7b152b02320 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Wed, 12 Jan 2022 22:51:54 +0100 Subject: [PATCH] Problem: lines for - are not supported in copy paste Solution: adjust regex so as not to split there --- 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 1dc9c8a..9fb6a52 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(/( *)- /) + let lines = inputString.split(/^|\n( *)- /) lines.shift() const firstItem = store.value(id) const firstIndent = firstItem.indented