You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
277 B
11 lines
277 B
2 years ago
|
const { parseDOM } = require("htmlparser2");
|
||
|
const serialize = require("dom-serializer");
|
||
|
|
||
|
module.exports = function render(code, ...processors) {
|
||
|
const dom = parseDOM(code, { xmlMode: true });
|
||
|
|
||
|
processors.forEach(processor => processor(dom));
|
||
|
|
||
|
return serialize(dom);
|
||
|
};
|