update pdf page to clipboard

This commit is contained in:
zsviczian
2023-05-13 15:21:25 +02:00
parent 2de1ba1f45
commit 7b76acd9c9
2 changed files with 4 additions and 3 deletions

View File

@@ -31,6 +31,7 @@ if(!text) {
return;
}
pdfDoc.destroy();
window.navigator.clipboard.writeText(text.items.map(t=>t.str).join("\n"));
window.navigator.clipboard.writeText(
text.items.reduce((acc, cur) => acc + cur.str.replace(/\x00/ug, '') + (cur.hasEOL ? "\n" : ""),"")
);
new Notice("Page text is available on the clipboard");

File diff suppressed because one or more lines are too long