From b9af8effabb82a83a9e66ae75be684c4d5798544 Mon Sep 17 00:00:00 2001 From: GuanMu Date: Fri, 18 Apr 2025 13:31:54 +0000 Subject: [PATCH] fix: handle empty heading text in TOC generation --- web/app/(commonLayout)/datasets/Doc.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/(commonLayout)/datasets/Doc.tsx b/web/app/(commonLayout)/datasets/Doc.tsx index 30ab724c0f..609144962c 100644 --- a/web/app/(commonLayout)/datasets/Doc.tsx +++ b/web/app/(commonLayout)/datasets/Doc.tsx @@ -38,7 +38,7 @@ const useToc = (apiBaseUrl: string, locale: string) => { const tocItems: TocItem[] = headingElementsArray.map((heading, index) => ({ href: `#section-${index}`, - text: (heading.textContent || `章节 ${index + 1}`).trim(), + text: (heading.textContent || '').trim(), index, }))