Update test/helpers.ts

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
pull/7426/head
Simon H 4 years ago committed by tanhauhau
parent 0363be1a6d
commit ae898c20a4

@ -145,7 +145,7 @@ export function normalizeHtml(window, html, { removeDataSvelte = false, preserve
const node = window.document.createElement('div'); const node = window.document.createElement('div');
node.innerHTML = html node.innerHTML = html
.replace(/(<!--.*?-->)/g, preserveComments ? '$1' : '') .replace(/(<!--.*?-->)/g, preserveComments ? '$1' : '')
.replace(/(data-svelte="[^"]+")/g, removeDataSvelte ? '': '$1') .replace(/(data-svelte="[^"]+")/g, removeDataSvelte ? '' : '$1')
.replace(/>[\s\r\n]+</g, '><') .replace(/>[\s\r\n]+</g, '><')
.trim(); .trim();
cleanChildren(node); cleanChildren(node);

Loading…
Cancel
Save