Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function compiler(tree) {
const node = toDOM(tree, settings);
const serialized = new XMLSerializer().serializeToString(node);
// XMLSerializer puts xmlns on root elements (typically the document
// element, but in case of a fragment all of the fragments children).
// We’re using the DOM, and we focus on HTML, so we can always remove HTML
// XMLNS attributes (HTML inside SVG does not need to have an XMLNS).
return serialized.replace(htmlXmlnsExpression, '');
}
}