From 9099fb9ec80cd3be54bc37d16df9ea136ec3c0a2 Mon Sep 17 00:00:00 2001 From: 3y3 <3y3@ya.ru> Date: Tue, 5 Nov 2024 19:02:23 +0300 Subject: [PATCH] fix: Fix toc resolving for dir paths --- src/services/tocs.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/services/tocs.ts b/src/services/tocs.ts index b11d5512..c8da036f 100644 --- a/src/services/tocs.ts +++ b/src/services/tocs.ts @@ -154,6 +154,12 @@ function getForPath(path: string): [string | null, YfmToc | null] { tocData = storage.get(path) || null; } + if (!tocData && path.endsWith('index.yaml')) { + path = path.replace('index.yaml', ''); + tocPath = paths.get(path) || null; + tocData = storage.get(path) || null; + } + return [tocPath, tocData]; }