We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be21637 commit a0ae0b2Copy full SHA for a0ae0b2
src/core/render/compiler.js
@@ -200,13 +200,10 @@ export class Compiler {
200
if (toc[i].ignoreSubHeading) {
201
const deletedHeaderLevel = toc[i].depth;
202
toc.splice(i, 1);
203
- // Remove headers who are under current header
204
- for (
205
- let j = i;
206
- j < toc.length && deletedHeaderLevel < toc[j].depth;
207
- j++
208
- ) {
209
- toc.splice(j, 1) && j-- && i++;
+
+ // Remove all following headings with greater depth
+ while (i < toc.length && toc[i].depth > deletedHeaderLevel) {
+ toc.splice(i, 1);
210
}
211
212
i--;
0 commit comments