Skip to content

Commit 3360673

Browse files
committed
fix(test-utils): repair overzealous optimization
1 parent 0f34f75 commit 3360673

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/test-utils/format-html.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ export function formatHTML(src: string): string {
3939
const styleMatch = src.slice(pos).match(/<style([\s\S]*?)>([\s\S]*?)<\/style>/);
4040
if (styleMatch) {
4141
// opening tag
42-
const [, attrs, textContent] = styleMatch;
42+
const [wholeMatch, attrs, textContent] = styleMatch;
4343
res += getPadding() + `<style${attrs}>` + '\n';
4444
depth++;
4545
res += getPadding() + textContent + '\n';
4646
depth--;
4747
res += getPadding() + '</style>' + '\n';
48+
pos = pos + wholeMatch.length;
4849
continue;
4950
}
5051
}

0 commit comments

Comments
 (0)