mirror of
https://github.com/penxio/penx.git
synced 2026-04-19 03:03:06 -04:00
fix: fix copy single line bug
This commit is contained in:
@@ -14,6 +14,12 @@ export const withCopy = (editor: PenxEditor) => {
|
||||
|
||||
const nodes = Array.from(entries)
|
||||
|
||||
// console.log('==========nodes:', nodes)
|
||||
|
||||
if (nodes.length < 2) {
|
||||
return setFragmentData(data, event)
|
||||
}
|
||||
|
||||
const lines = nodes.map((item) => '- ' + Node.string(item[0]))
|
||||
// console.log('====nodes:', nodes, lines)
|
||||
data.setData('text/plain', lines.join('\n'))
|
||||
|
||||
Reference in New Issue
Block a user