pull/3440/head
zonemeen 8 months ago
parent edefeb8033
commit 9d89d0e8dd

@ -127,7 +127,7 @@ export async function localSearchPlugin(
function getParentTitles(sidebar: SidebarItem[], fileId: string) { function getParentTitles(sidebar: SidebarItem[], fileId: string) {
const titles: string[] = [], const titles: string[] = [],
path: string[] = [] path: string[] = []
const backtrack = (sidebar: SidebarItem[]) => { const backtrack = (sidebar: SidebarItem[] | undefined) => {
if (!sidebar) return if (!sidebar) return
for (let i = 0; i < sidebar?.length; i++) { for (let i = 0; i < sidebar?.length; i++) {
if (sidebar[i].link === fileId) { if (sidebar[i].link === fileId) {
@ -135,7 +135,7 @@ export async function localSearchPlugin(
return return
} }
path.push(sidebar[i].text!) path.push(sidebar[i].text!)
backtrack(sidebar[i].items!) backtrack(sidebar[i].items)
path.pop() path.pop()
} }
} }

Loading…
Cancel
Save