From 9969182adebeef2405c882d5a883662cc65cc7cb Mon Sep 17 00:00:00 2001 From: Tyler Akins Date: Mon, 29 Jul 2024 08:23:13 -0500 Subject: [PATCH] Reducing size by using different parser --- src/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index ce5c6ed..3f421ec 100644 --- a/src/index.ts +++ b/src/index.ts @@ -82,10 +82,7 @@ export class Cona extends HTMLElement { private _update(shouldShallowCompareProps = false) { if (shouldShallowCompareProps && this._shadowCompareObject(this._op, this.props)) return; const renderString = this.render?.(this._render.bind(this)); - const { body } = new DOMParser().parseFromString( - renderString || "", - "text/html", - ); + const body = Document.parseHTMLUnsafe(renderString || "").body; const styleElement = document.createElement("style"); styleElement.innerHTML = Cona.style; this._pathDomDiffing(this._sr!, body, styleElement);