0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-04 01:24:56 +02:00

fix some issue/pull URLs in javascript

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2025-08-18 16:47:44 -04:00
parent 92cb2a7080
commit df36c83b76
No known key found for this signature in database
GPG Key ID: 924A5F6AF051E87C
2 changed files with 3 additions and 2 deletions

View File

@ -24,6 +24,7 @@ export type RepoOwnerPathInfo = {
export type IssuePathInfo = {
ownerName: string,
repoName: string,
group: string,
pathType: string,
indexString: string,
};

View File

@ -63,8 +63,8 @@ export function urlQueryEscape(s: string) {
export function parseIssueHref(href: string): IssuePathInfo {
// FIXME: it should use pathname and trim the appSubUrl ahead
const path = (href || '').replace(/[#?].*$/, '');
const [_, ownerName, repoName, pathType, indexString] = /([^/]+)\/([^/]+)\/(issues|pulls)\/([0-9]+)/.exec(path) || [];
return {ownerName, repoName, pathType, indexString};
const [_, ownerName, group, repoName, pathType, indexString] = /([^/]+)\/(?:group\/([^/]+)\/)?([^/]+)\/(issues|pulls)\/([0-9]+)/.exec(path) || [];
return {ownerName, repoName, pathType, group, indexString};
}
export function parseRepoOwnerPathInfo(pathname: string): RepoOwnerPathInfo {