This commit is contained in:
hypercross 2026-03-20 09:01:21 +08:00
parent d19401373f
commit 7a490b82df
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ export function extractHeadings(content: string): TocNode[] {
const slugger = new Slugger(); const slugger = new Slugger();
for (const line of lines) { for (const line of lines) {
const match = line.match(/^(#{1,6})\s+(.+)$/); const match = line.trim().match(/^(#{1,6})\s+(.+)$/);
if (!match) continue; if (!match) continue;
const level = match[1].length; const level = match[1].length;