@@ -19,7 +19,7 @@ import { Resource } from '../common/resources';
1919import { GITHUB_ENTERPRISE , OVERRIDE_DEFAULT_BRANCH , PR_SETTINGS_NAMESPACE , URI } from '../common/settingKeys' ;
2020import * as Common from '../common/timelineEvent' ;
2121import { DataUri , toOpenIssueWebviewUri , toOpenPullRequestWebviewUri } from '../common/uri' ;
22- import { gitHubLabelColor , stringReplaceAsync , uniqBy } from '../common/utils' ;
22+ import { escapeRegExp , gitHubLabelColor , stringReplaceAsync , uniqBy } from '../common/utils' ;
2323import { OctokitCommon } from './common' ;
2424import { FolderRepositoryManager , PullRequestDefaults } from './folderRepositoryManager' ;
2525import { GitHubRepository , ViewerPermission } from './githubRepository' ;
@@ -309,7 +309,7 @@ export function convertRESTHeadToIGitHubRef(head: OctokitCommon.PullsListRespons
309309
310310async function transformHtmlUrlsToExtensionUrls ( body : string , githubRepository : GitHubRepository ) : Promise < string > {
311311 const issueRegex = new RegExp (
312- `href="https?:\/\/${ githubRepository . remote . gitProtocol . url . authority } \\/${ githubRepository . remote . owner } \\/${ githubRepository . remote . repositoryName } \\/(issues|pull)\\/([0-9]+)"` ) ;
312+ `href="https?:\/\/${ escapeRegExp ( githubRepository . remote . gitProtocol . url . authority ) } \\/${ escapeRegExp ( githubRepository . remote . owner ) } \\/${ escapeRegExp ( githubRepository . remote . repositoryName ) } \\/(issues|pull)\\/([0-9]+)"` ) ;
313313 return stringReplaceAsync ( body , issueRegex , async ( match : string , issuesOrPull : string , number : string ) => {
314314 if ( issuesOrPull === 'issues' ) {
315315 return `href="${ ( await toOpenIssueWebviewUri ( { owner : githubRepository . remote . owner , repo : githubRepository . remote . repositoryName , issueNumber : Number ( number ) } ) ) . toString ( ) } ""` ;
0 commit comments