As discussed here (#2781 (comment)), we are currently using createContextualFragment only for IE11 support.
function createFragment(html: string): Node | null {
return document.createRange().createContextualFragment(html).firstChild;
}
We should switch to this:
const template = document.createElement('template')
export function createFragment(html: string): Node | null {
template.innerHTML = html
return template.content.firstChild
}
This will require disabling the static optimization in compat mode, though. This would allow us to also re-enable the optimization for nodes like <td> and <th>.