MCPcopy Create free account
hub / github.com/CanadaHonk/shadow / cleanup

Method cleanup

engine/htmlparser.js:303–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301
302 // remove any empty #text
303 const cleanup = x => {
304 for (let i = 0; i < x.children.length; i++) {
305 const y = x.children[i];
306 if (y.tagName === '#text' && y.content === '') {
307 x.children.splice(i, 1);
308 i--;
309 continue;
310 }
311
312 cleanup(y);
313 }
314 };
315 cleanup(this.document);
316
317 // add <html> if not there

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected