Skip to content

Commit

Permalink
process-html: fix a memory leak for playground
Browse files Browse the repository at this point in the history
Part of #888
  • Loading branch information
myfreeer committed Jul 16, 2023
1 parent ca775ee commit 1f549be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mdn/process-html/process-playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function sectionForHeading($: CheerioStatic, heading: Cheerio | null): Cheerio[]
return [...heading.children().map((_, el) => $(el))];
}
let next = heading.next();
while (next && partOfSection(heading, next)) {
while (next.length && partOfSection(heading, next)) {
nodes.push(next);
if (next.next().length === 0) {
next = next.parent().next().children().first() || null;
Expand Down

0 comments on commit 1f549be

Please sign in to comment.