D is wrong but also right but also wrong but most importantly I'm right but also wrong I guess?

This commit is contained in:
Hamcha 2020-06-17 18:49:38 +02:00
parent 2066991942
commit 377a549d17
Signed by untrusted user: hamcha
GPG key ID: 41467804B19A3315

View file

@ -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);