From 9fbb5f0d68a131b55bc172d46b75705f2842af04 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Wed, 15 Jul 2026 01:46:06 -0400 Subject: Replace null overview files with HTML comments Co-Authored-By: Claude Fable 5 --- cgithub/src/scraper.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cgithub/src/scraper.ts') diff --git a/cgithub/src/scraper.ts b/cgithub/src/scraper.ts index 760a306..53f2bb1 100644 --- a/cgithub/src/scraper.ts +++ b/cgithub/src/scraper.ts @@ -31,7 +31,8 @@ interface TreeItem { interface OverviewFile { displayName: string; - richText?: string; + // null when GitHub includes the file without rendered content. + richText?: string | null; } interface IssueNode { @@ -220,7 +221,7 @@ interface GitHubNav extends GitHubCommon { export interface GitHubTree extends GitHubNav { items: TreeItem[]; - overviewHtml?: Record; + overviewHtml?: Record; } export interface RepoInfo { @@ -443,8 +444,8 @@ function parseRepoInfo(html: string): RepoInfo { function extractOverviewHtml( overviewFiles: OverviewFile[] = [], -): Record | undefined { - const result: Record = {}; +): Record | undefined { + const result: Record = {}; for (const file of overviewFiles) { if (file.richText !== undefined) { result[file.displayName] = file.richText; -- cgit v1.3.1