Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/components/IssueList.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down