From 377a549d17a23e7ff10de162161265fe199d56c9 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Wed, 17 Jun 2020 18:49:38 +0200 Subject: [PATCH] D is wrong but also right but also wrong but most importantly I'm right but also wrong I guess? --- lib/userscript.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/userscript.ts b/lib/userscript.ts index ece4258..ac9253e 100644 --- a/lib/userscript.ts +++ b/lib/userscript.ts @@ -97,7 +97,7 @@ export default function userscript(root: HTMLElement, docname: string): void { // The cast to Array is necessary because, while childNodes's NodeList technically has a forEach method, it's a live list and operations mess with its lenght in the middle of the loop. // Nodes can only have one parent so append removes them from the original NodeList and shifts the following one back into the wrong index. Array.from(td.childNodes).forEach((el) => { - if (el instanceof Element && el.tagName === "P") { + if (el instanceof HTMLParagraphElement) { tmp.append(...el.childNodes); } else { tmp.append(el);