@@ -7,6 +7,7 @@ import ip = require("./utils/installPackages");
7
7
import ut = require( "./utils/userTestUtils" ) ;
8
8
import fs = require( "fs" ) ;
9
9
import path = require( "path" ) ;
10
+ import mdEscape = require( "markdown-escape" ) ;
10
11
import randomSeed = require( "random-seed" ) ;
11
12
12
13
interface Params {
@@ -270,10 +271,10 @@ async function getTsServerRepoResult(
270
271
: `Timed out after ${ executionTimeout } ms` ) ) ;
271
272
}
272
273
273
- const owner = repo . owner ? `${ repo . owner } /` : "" ;
274
+ const owner = repo . owner ? `${ mdEscape ( repo . owner ) } /` : "" ;
274
275
const url = repo . url ? `(${ repo . url } )` : "" ;
275
276
276
- let summary = `## [${ owner } ${ repo . name } ]${ url } \n` ;
277
+ let summary = `## [${ owner } ${ mdEscape ( repo . name ) } ]${ url } \n` ;
277
278
278
279
if ( oldServerFailed ) {
279
280
const oldServerError = oldSpawnResult ?. stdout
@@ -322,7 +323,7 @@ ${fs.readFileSync(replayScriptPath, { encoding: "utf-8" }).split(/\r?\n/).slice(
322
323
summary += `<li>Download user test <code>${ repo . name } </code></li>\n` ;
323
324
}
324
325
else {
325
- summary += `<li><code>git clone ${ repo . url } --recurse-submodules</code></li>\n` ;
326
+ summary += `<li><code>git clone ${ repo . url ! } --recurse-submodules</code></li>\n` ;
326
327
327
328
try {
328
329
console . log ( "Extracting commit SHA for repro steps" ) ;
@@ -420,12 +421,12 @@ export async function getTscRepoResult(
420
421
}
421
422
422
423
let sawDifferentErrors = false ;
423
- const owner = repo . owner ? `${ repo . owner } /` : "" ;
424
+ const owner = repo . owner ? `${ mdEscape ( repo . owner ) } /` : "" ;
424
425
const url = repo . url ?? "" ;
425
426
426
427
let summary = `<details open="true">
427
428
<summary>
428
- <h2><a href="${ url } ">${ owner } ${ repo . name } </a></h2>
429
+ <h2><a href="${ url } ">${ owner } ${ mdEscape ( repo . name ) } </a></h2>
429
430
</summary>
430
431
431
432
` ;
@@ -838,7 +839,7 @@ function makeMarkdownLink(url: string) {
838
839
const match = / \/ b l o b \/ [ a - f 0 - 9 ] + \/ ( .+ ) $ / . exec ( url ) ;
839
840
return ! match
840
841
? url
841
- : `[${ match [ 1 ] } ](${ url } )` ;
842
+ : `[${ mdEscape ( match [ 1 ] ) } ](${ url } )` ;
842
843
}
843
844
844
845
async function downloadTsAsync ( cwd : string , params : GitParams | UserParams ) : Promise < { oldTsEntrypointPath : string , oldTsResolvedVersion : string , newTsEntrypointPath : string , newTsResolvedVersion : string } > {
0 commit comments