From 60c564cabfeb8d443d982c42215c69a8d3f198b4 Mon Sep 17 00:00:00 2001 From: maybe <1126651826@qq.com> Date: Thu, 10 Mar 2022 10:47:53 +0800 Subject: [PATCH] fix replace label for copying to excel line breaks --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 38b0680..0cae525 100755 --- a/index.js +++ b/index.js @@ -33,7 +33,9 @@ function copy(text, options) { range = document.createRange(); selection = document.getSelection(); - mark = document.createElement("span"); + // mark = document.createElement("span"); + // copy to excel line breaks + mark = document.createElement("pre"); mark.textContent = text; // reset user styles for span element mark.style.all = "unset";