fix: add null checks to parsers and fix docs path

This commit is contained in:
2026-03-18 16:13:57 +08:00
parent ff48936402
commit 4898ee5434
8 changed files with 20 additions and 4 deletions

View File

@@ -8,6 +8,10 @@ const HR_REGEX = /^---+$/
const REFERENCE_REGEX = /@see\s+([^\s]+)/g
export function parseMarkdown(content: string): ParsedDoc {
if (!content || typeof content !== 'string') {
return { title: '', metadata: {}, sections: [], references: [] };
}
const lines = content.split('\n')
const result: ParsedDoc = {
title: '',