mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-21 09:41:40 +02:00
fix some issue/pull URLs in javascript
This commit is contained in:
@@ -24,6 +24,7 @@ export type RepoOwnerPathInfo = {
|
|||||||
export type IssuePathInfo = {
|
export type IssuePathInfo = {
|
||||||
ownerName: string,
|
ownerName: string,
|
||||||
repoName: string,
|
repoName: string,
|
||||||
|
group: string,
|
||||||
pathType: string,
|
pathType: string,
|
||||||
indexString: string,
|
indexString: string,
|
||||||
};
|
};
|
||||||
|
|||||||
+2
-2
@@ -63,8 +63,8 @@ export function urlQueryEscape(s: string) {
|
|||||||
export function parseIssueHref(href: string): IssuePathInfo {
|
export function parseIssueHref(href: string): IssuePathInfo {
|
||||||
// FIXME: it should use pathname and trim the appSubUrl ahead
|
// FIXME: it should use pathname and trim the appSubUrl ahead
|
||||||
const path = (href || '').replace(/[#?].*$/, '');
|
const path = (href || '').replace(/[#?].*$/, '');
|
||||||
const [_, ownerName, repoName, pathType, indexString] = /([^/]+)\/([^/]+)\/(issues|pulls)\/([0-9]+)/.exec(path) || [];
|
const [_, ownerName, group, repoName, pathType, indexString] = /([^/]+)\/(?:group\/([^/]+)\/)?([^/]+)\/(issues|pulls)\/([0-9]+)/.exec(path) || [];
|
||||||
return {ownerName, repoName, pathType, indexString};
|
return {ownerName, repoName, pathType, group, indexString};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parseRepoOwnerPathInfo(pathname: string): RepoOwnerPathInfo {
|
export function parseRepoOwnerPathInfo(pathname: string): RepoOwnerPathInfo {
|
||||||
|
|||||||
Reference in New Issue
Block a user