mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 01:36:24 +01:00
Switch scripts to redesign
This commit is contained in:
7
src/scripts/common/parsehtml.ts
Normal file
7
src/scripts/common/parsehtml.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function parseHTML(html: string, fragment = false) {
|
||||
const template = document.createElement("template");
|
||||
template.innerHTML = html;
|
||||
const node = template.content.cloneNode(true);
|
||||
if (fragment) return node;
|
||||
return node.childNodes.length > 1 ? node.childNodes : node.childNodes[0];
|
||||
}
|
||||
Reference in New Issue
Block a user