mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
clipper(web): make ready for publishing
This commit is contained in:
@@ -293,8 +293,10 @@ function clonePseudoElements(
|
||||
}
|
||||
|
||||
function copyUserInput(original: HTMLElement, clone: HTMLElement) {
|
||||
if (original instanceof HTMLTextAreaElement) clone.innerHTML = original.value;
|
||||
if (original instanceof HTMLInputElement)
|
||||
if (
|
||||
original instanceof HTMLInputElement ||
|
||||
original instanceof HTMLTextAreaElement
|
||||
)
|
||||
clone.setAttribute("value", original.value);
|
||||
}
|
||||
|
||||
|
||||
@@ -429,10 +429,9 @@ function getElementViewportInfo(el: HTMLElement) {
|
||||
}
|
||||
|
||||
function toDocument(head: HTMLElement, body: HTMLElement) {
|
||||
const newHTMLDocument = document.implementation.createHTMLDocument();
|
||||
newHTMLDocument.head.outerHTML = head.outerHTML;
|
||||
newHTMLDocument.body.outerHTML = body.outerHTML;
|
||||
return newHTMLDocument;
|
||||
const doc = document.implementation.createHTMLDocument();
|
||||
doc.documentElement.replaceChildren(head, body);
|
||||
return doc;
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
@@ -475,7 +474,7 @@ async function getPage(
|
||||
|
||||
const head = document.createElement("head");
|
||||
const title = document.createElement("title");
|
||||
title.innerHTML = document.title;
|
||||
title.innerText = document.title;
|
||||
head.appendChild(title);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user