0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-09 22:22:41 +00:00
Fix ToC generator snippet
This commit is contained in:
Trevor Buckner
2024-07-02 11:55:39 -04:00
committed by GitHub

View File

@@ -8,14 +8,14 @@ const getTOC = (pages)=>{
if(curDepth == targetDepth) { if(curDepth == targetDepth) {
child.push({ child.push({
title : title, title : title,
page : page + 1, page : page,
children : [] children : []
}); });
} else { } else {
if(child.length == 0) { if(child.length == 0) {
child.push({ child.push({
title : null, title : null,
page : page + 1, page : page,
children : [] children : []
}); });
} }