Refactor HTMLFormat, update chroma render, fix js error (#33136)
A small refactor to improve HTMLFormat, to help to prevent low-level mistakes. And fix #33141, fix #33139
This commit is contained in:
parent
67aeb1f896
commit
386c1ed908
12 changed files with 34 additions and 17 deletions
|
@ -40,7 +40,7 @@ export function parseIssueHref(href: string): IssuePathInfo {
|
|||
export function parseIssueNewHref(href: string): IssuePathInfo {
|
||||
const path = (href || '').replace(/[#?].*$/, '');
|
||||
const [_, ownerName, repoName, pathTypeField] = /([^/]+)\/([^/]+)\/(issues\/new|compare\/.+\.\.\.)/.exec(path) || [];
|
||||
const pathType = pathTypeField.startsWith('issues/new') ? 'issues' : 'pulls';
|
||||
const pathType = pathTypeField ? (pathTypeField.startsWith('issues/new') ? 'issues' : 'pulls') : undefined;
|
||||
return {ownerName, repoName, pathType};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue