function normalize_html(window, html, { preserveComments = false } = {}) {
	try {
		const node = window.document.createElement('div');

		node.innerHTML = html.trim();
		clean_children(node, { preserveComments });

		return node.innerHTML;
	} catch (err) {
		throw new Error(`Failed to normalize HTML:\n${html}\nCause: ${err}`);
	}
}
@param {Window} window
@param {string} html
@param {{ preserveComments?: boolean }} opts