Skip to content

Commit 2484ef6

Browse files
committed
add comments
1 parent 190b089 commit 2484ef6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tools/doc/html.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ export function preprocessElements({ filename }) {
233233
}
234234
}
235235
heading = node;
236-
return [true, index + 1];
237236
} else if (node.type === 'code') {
238237
if (!node.lang) {
239238
console.warn(
@@ -340,6 +339,10 @@ export function preprocessElements({ filename }) {
340339
node.children.push({ type: 'html', value: '</div>' });
341340
}
342341
}
342+
343+
// In case we've inserted/removed node(s) before the current one, we need
344+
// to make sure we're not visiting the same node again or skipping one.
345+
return [true, index + 1];
343346
});
344347
};
345348
}

0 commit comments

Comments
 (0)