fix:plain text cannot copy linefeed

pr675
Hufe921 4 years ago
parent 853c783a96
commit d8eb332120

@ -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)

Loading…
Cancel
Save