(html)
| 117 | } |
| 118 | |
| 119 | function htmlToDoc(html) { |
| 120 | const p5doc = parse5.parse(html, { sourceCodeLocationInfo: true }) |
| 121 | const impl = new DOMImplementation() |
| 122 | const doc = impl.createDocument(null, null, null) |
| 123 | walkParse5(p5doc, doc, doc) |
| 124 | return { doc, source: html } |
| 125 | } |
| 126 | |
| 127 | function walkParse5(p5node, xmlParent, xmlDoc) { |
| 128 | for (const child of p5node.childNodes || []) { |