cs142/project3/node_modules/domutils/test/utils.js
2020-08-01 19:26:11 -03:00

10 lines
229 B
JavaScript

var htmlparser = require("htmlparser2");
exports.makeDom = function(markup) {
var handler = new htmlparser.DomHandler(),
parser = new htmlparser.Parser(handler);
parser.write(markup);
parser.done();
return handler.dom;
};