Skip to content

Commit 7c25ea7

Browse files
fix some issue/pull URLs in javascript
1 parent 3feeb44 commit 7c25ea7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

web_src/js/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export type RepoOwnerPathInfo = {
4040
export type IssuePathInfo = {
4141
ownerName: string,
4242
repoName: string,
43+
group: string,
4344
pathType: string,
4445
indexString?: string,
4546
};

web_src/js/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export function stripTags(text: string): string {
4646
export function parseIssueHref(href: string): IssuePathInfo {
4747
// FIXME: it should use pathname and trim the appSubUrl ahead
4848
const path = (href || '').replace(/[#?].*$/, '');
49-
const [_, ownerName, repoName, pathType, indexString] = /([^/]+)\/([^/]+)\/(issues|pulls)\/([0-9]+)/.exec(path) || [];
50-
return {ownerName, repoName, pathType, indexString};
49+
const [_, ownerName, group, repoName, pathType, indexString] = /([^/]+)\/(?:group\/([^/]+)\/)?([^/]+)\/(issues|pulls)\/([0-9]+)/.exec(path) || [];
50+
return {ownerName, repoName, pathType, group, indexString};
5151
}
5252

5353
export function parseRepoOwnerPathInfo(pathname: string): RepoOwnerPathInfo {

0 commit comments

Comments
 (0)