From 306a6717cc7aa39c328b59c38522ed25f7c0b268 Mon Sep 17 00:00:00 2001 From: silvertech-daniel <153660991+silvertech-daniel@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:20:28 -0400 Subject: [PATCH] fix(block-tools): remove references to implicit globals `document` and `Text` (#7532) --- .../block-tools/src/HtmlDeserializer/preprocessors/word.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@sanity/block-tools/src/HtmlDeserializer/preprocessors/word.ts b/packages/@sanity/block-tools/src/HtmlDeserializer/preprocessors/word.ts index 8d67841d195..5fb3e4cba60 100644 --- a/packages/@sanity/block-tools/src/HtmlDeserializer/preprocessors/word.ts +++ b/packages/@sanity/block-tools/src/HtmlDeserializer/preprocessors/word.ts @@ -70,16 +70,16 @@ export default (html: string, doc: Document): Document => { for (let i = mappedElements.snapshotLength - 1; i >= 0; i--) { const mappedElm = mappedElements.snapshotItem(i) as HTMLElement const tags = elementMap[mappedElm.className] - const text = new Text(mappedElm.textContent || '') + const text = doc.createTextNode(mappedElm.textContent || '') if (!tags) { continue } - const parentElement = document.createElement(tags[0]) + const parentElement = doc.createElement(tags[0]) let parent = parentElement let child = parentElement tags.slice(1).forEach((tag) => { - child = document.createElement(tag) + child = doc.createElement(tag) parent.appendChild(child) parent = child })