Skip to content

Commit 74f8931

Browse files
authored
Fix hidden section not found (#3836)
1 parent 9e1d7b2 commit 74f8931

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.changeset/tiny-carrots-rush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Fix hidden section not found

packages/gitbook/src/lib/context.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,7 @@ function parseVisibleSiteSectionsAndGroups(structure: SiteStructure, siteSection
465465
siteSectionId
466466
);
467467
const visibleSectionsAndGroups = filterSectionsAndGroupsWithHiddenSiteSpaces(sectionsAndGroups);
468-
const current = section && !sectionHasOnlyHiddenSiteSpaces(section) ? section : null;
469-
assert(current, `couldn't find section "${siteSectionId}" in site structure`);
470-
return { list: visibleSectionsAndGroups, current } satisfies SiteSections;
468+
return { list: visibleSectionsAndGroups, current: section } satisfies SiteSections;
471469
}
472470

473471
function parseCurrentSection(structure: SiteStructure, siteSectionId: string) {

0 commit comments

Comments
 (0)