Skip to content

Commit c9c1e73

Browse files
committed
fix infinte loops when missing portions of properties
1 parent a599d71 commit c9c1e73

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/render/src/shared/utils/lenient-parse.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ export const lenientParse = (html: string): HtmlNode[] => {
130130
}
131131

132132
if (character !== ' ') {
133+
if (html.indexOf('=', index) === -1) {
134+
index =
135+
html.indexOf('/>') === -1 ? html.indexOf('>') : html.indexOf('/>');
136+
break;
137+
}
133138
const propertyName = html.slice(index, html.indexOf('=', index));
134139
index = html.indexOf('=', index) + 1;
135140

0 commit comments

Comments
 (0)