0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-04 03:52:40 +00:00

Remove page + 1 from ToC generator snippet

This commit is contained in:
G.Ambatte
2024-07-02 20:46:01 +12:00
parent 2cdd65b083
commit 7c60fbe655

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 : []
}); });
} }