From f4c04f4b31b2632cc2c84c7faa2f7ea28891ed5d Mon Sep 17 00:00:00 2001 From: Guillermo Barreto <124272218+GuillermoBarreto@users.noreply.github.com> Date: Mon, 9 Nov 2026 18:39:18 -0600 Subject: [PATCH] Fix issue loading for project links with URL fragments --- src/components/IssueList.astro | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/IssueList.astro b/src/components/IssueList.astro index a04b60a4..ae5e5d45 100644 --- a/src/components/IssueList.astro +++ b/src/components/IssueList.astro @@ -7,12 +7,16 @@ export interface Props { const { projectLink, projectName } = Astro.props; // Extract owner/repo from GitHub URL +// Project links may carry a #fragment (e.g. #contributing) or a trailing +// slash; strip both first, otherwise the fragment ends up in the repo name +// and the issues API request breaks (the fragment swallows /issues?...). function extractRepoInfo(url: string) { - const match = url.match(/github\.com\/([^\/]+)\/([^\/]+)/); + const cleanUrl = url.split(/[?#]/)[0].replace(/\/$/, ''); + const match = cleanUrl.match(/github\.com\/([^\/]+)\/([^\/]+)/); if (match) { return { owner: match[1], - repo: match[2].replace(/\/$/, '') // Remove trailing slash + repo: match[2] }; } return null;