]*class="[^"]*f4[^"]*"[^>]*>([\s\S]*?)<\/p>/);
const description = descMatch?.[1]?.replace(/<[^>]+>/g, "").trim() || null;
const websiteMatch = html.match(/]*rel="noopener noreferrer nofollow"[^>]*href="([^"]+)"/);
const starsMatch = html.match(/id="repo-stars-counter-star"[^>]*>([^<]+)/);
const watchersMatch = html.match(/(\d+)<\/strong>\s*watching/);
const forksMatch = html.match(/id="repo-network-counter"[^>]*>([^<]+)/);
let numReleases: number | undefined;
const releaseCountMatch = html.match(
/]*href="[^"]*\/releases"[^>]*>[\s\S]*?]*title="(\d+)"[^>]*(?:class="[^"]*Counter|data-view-component="true")[^>]*>/,
);
if (releaseCountMatch) {
numReleases = parseInt(releaseCountMatch[1], 10);
}
return {
description,
website: websiteMatch?.[1] || null,
stars: starsMatch?.[1]?.trim() || null,
watchers: watchersMatch?.[1] || null,
forks: forksMatch?.[1]?.trim() || null,
numReleases,
};
}
function extractOverviewHtml(payload: RawPayload): Record]*id="([^"]*)"[^>]*>(v[^<]*)<\/h2>/g;
for (const h2Match of html.matchAll(h2Regex)) {
const id = h2Match[1];
const title = h2Match[2].trim();
// Find the section containing this h2
const sectionRegex = new RegExp(
`
]*id="${id}"[^>]*>[^<]*<\\/h2>([\\s\\S]*?)<\\/section>`,
"s",
);
const sectionMatch = html.match(sectionRegex);
if (!sectionMatch) continue;
const sectionHtml = sectionMatch[1];
// Extract tag name from link
const tagMatch = sectionHtml.match(/]*href="[^"]*\/tree\/([^"]+)"[^>]*>/);
const tagName = tagMatch?.[1] || title;
// Extract published date
const dateMatch = sectionHtml.match(/