This commit is contained in:
Domen Kožar
2019-11-13 17:14:48 +01:00
parent d1407282e6
commit 08403cd828
6774 changed files with 1602535 additions and 1 deletions

18
node_modules/jsdom/lib/jsdom/browser/domtohtml.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
"use strict";
const parse5 = require("parse5");
const treeAdapter = require("./parse5-adapter-serialization");
const NODE_TYPE = require("../living/node-type");
exports.domToHtml = iterable => {
let ret = "";
for (const node of iterable) {
if (node.nodeType === NODE_TYPE.DOCUMENT_NODE) {
ret += parse5.serialize(node, { treeAdapter });
} else {
// TODO: maybe parse5 can give us a hook where it serializes the node itself too:
// https://github.com/inikulin/parse5/issues/230
ret += parse5.serialize({ childNodesForSerializing: [node] }, { treeAdapter });
}
}
return ret;
};