mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
fix(sidebar): remove ignored headings and children (#2580)
This commit is contained in:
parent
22ac7e855d
commit
2a49bd0aa4
@ -200,13 +200,10 @@ export class Compiler {
|
||||
if (toc[i].ignoreSubHeading) {
|
||||
const deletedHeaderLevel = toc[i].depth;
|
||||
toc.splice(i, 1);
|
||||
// Remove headers who are under current header
|
||||
for (
|
||||
let j = i;
|
||||
j < toc.length && deletedHeaderLevel < toc[j].depth;
|
||||
j++
|
||||
) {
|
||||
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);
|
||||
}
|
||||
|
||||
i--;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user