Problem: first line of pasted text is not saved
All checks were successful
continuous-integration/drone/push Build is passing

Solution: change regex of input string split
This commit is contained in:
Peter Stuifzand 2022-01-12 23:58:36 +01:00
parent d3cde5fd94
commit f3fa3a0a91

View File

@ -527,7 +527,7 @@ function editor(root, inputData, options) {
if (inputString.match(/^- /)) { if (inputString.match(/^- /)) {
let item = $(this).parents('.list-item') let item = $(this).parents('.list-item')
let id = item.attr('data-id') let id = item.attr('data-id')
let lines = inputString.split(/^|\n( *)- /) let lines = inputString.split(/^( *)- /ms)
lines.shift() lines.shift()
const firstItem = store.value(id) const firstItem = store.value(id)
const firstIndent = firstItem.indented const firstIndent = firstItem.indented