Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.renderToString = function renderToString(markup, options = {}) {
const parseHTML = options.strict ? html.strict : html;
const childNodes = typeof markup === 'string' ? parseHTML(markup) : markup;
const newTree = createTree('#document-fragment', {}, childNodes);
const oldTree = createTree(newTree.rawNodeName);
return innerHTML(oldTree, newTree, { tasks: [...tasks], options });
};