fix:plain text cannot copy linefeed
This commit is contained in:
@@ -94,7 +94,10 @@ export function writeElementList(elementList: IElement[], options: DeepRequired<
|
|||||||
}
|
}
|
||||||
buildDomFromElementList(zipElementList(elementList))
|
buildDomFromElementList(zipElementList(elementList))
|
||||||
// 写入剪贴板
|
// 写入剪贴板
|
||||||
|
document.body.append(clipboardDom)
|
||||||
const text = clipboardDom.innerText
|
const text = clipboardDom.innerText
|
||||||
|
// 先追加后移除,否则innerText无法解析换行符
|
||||||
|
clipboardDom.remove()
|
||||||
const html = clipboardDom.innerHTML
|
const html = clipboardDom.innerHTML
|
||||||
if (!text || !html) return
|
if (!text || !html) return
|
||||||
writeClipboardItem(text, html)
|
writeClipboardItem(text, html)
|
||||||
|
|||||||
Reference in New Issue
Block a user