Problem: copy and paste always creates new nodes
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Solution: allow one line text as normals text
This commit is contained in:
parent
e743576043
commit
c30156dd10
|
@ -526,14 +526,18 @@ function editor(root, inputData, options) {
|
|||
let items = pastedData.toString().split(/\n+/);
|
||||
let item = $(this).parents('.list-item')
|
||||
let id = item.attr('data-id')
|
||||
const firstItem = store.value(id)
|
||||
items = _.map(items, text => {
|
||||
const item = newListItem(firstItem.indented)
|
||||
item.text = text
|
||||
return item
|
||||
})
|
||||
store.insertAfter(id, ...items)
|
||||
trigger('change')
|
||||
if (items.length === 1) {
|
||||
return true
|
||||
} else {
|
||||
const firstItem = store.value(id)
|
||||
items = _.map(items, text => {
|
||||
const item = newListItem(firstItem.indented)
|
||||
item.text = text
|
||||
return item
|
||||
})
|
||||
store.insertAfter(id, ...items)
|
||||
trigger('change')
|
||||
}
|
||||
return false
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user