This commit is contained in:
Johannes Rieken
2020-10-05 13:59:43 +02:00
parent 81400337e7
commit 5d9b22c4fa
2 changed files with 8 additions and 1 deletions

View File

@@ -22,6 +22,13 @@ export function clearNode(node: HTMLElement): void {
}
}
export function trustedInnerHTML(node: Element, value: TrustedHTML): void {
// this is a workaround for innerHTML not allowing for "asymetric" accessors
// see https://github.com/microsoft/vscode/issues/106396#issuecomment-692625393
// and https://github.com/microsoft/TypeScript/issues/30024
node.innerHTML = value as unknown as string;
}
export function isInDOM(node: Node | null): boolean {
while (node) {
if (node === document.body) {