/** * RSC Content Extractor * * Extracts readable content from Next.js React Server Components (RSC) flight payloads. * RSC pages embed content as JSON in tags. */ export interface RSCExtractResult { title: string; content: string; } export function extractRSCContent(html: string): RSCExtractResult | null { if (!html.includes("self.__next_f.push")) { return null; } // Parse all RSC chunks into a map const chunkMap = new Map(); const scriptRegex = /