diff --git a/lib/review-brief.ts b/lib/review-brief.ts index 428f2efbf..86fc7ea6a 100644 --- a/lib/review-brief.ts +++ b/lib/review-brief.ts @@ -156,7 +156,7 @@ export function checkoutRoot(): string { * backtick wrapper, a bold label and backticks around the sha or the whole path are removed; the path's own characters are kept. */ function parseTreeLine(line: string): string | null { - const label = /^(?:\*\*)?[Pp]rinted:(?:\*\*)?\s+/; + const label = /^(?:\*\*[Pp]rinted:\*\*|[Pp]rinted:)\s+/; let t = line.trim().replace(/^(?:[-*>]\s+|\d+[.)]\s+|#+\s+)/, '').replace(label, ''); for (const w of ['**', '`']) if (t.length > 2 * w.length && t.startsWith(w) && t.endsWith(w)) t = t.slice(w.length, -w.length).trim(); t = t.replace(label, ''); diff --git a/test/review-dispatch.test.ts b/test/review-dispatch.test.ts index de81db952..2ffe37c02 100644 --- a/test/review-dispatch.test.ts +++ b/test/review-dispatch.test.ts @@ -593,7 +593,7 @@ describe('the REVIEWED_TREE line as GBRA-218 readers wrote it (GST-776)', () => expect(checkReviewedTree(reply(`${'b'.repeat(40)} ${top}`), `${tree} ${top}`)).toMatchObject({ ok: false, moved: true, reported: `${'b'.repeat(40)} ${top}` }); expect(checkReviewedTree(reply(`${tree} /elsewhere`), `${tree} ${top}`)).toMatchObject({ ok: false, moved: false, reported: `${tree} /elsewhere` }); expect(checkReviewedTree(`Note: REVIEWED_TREE: ${tree} ${top}\nNO FINDINGS`, `${tree} ${top}`).reported).toBe('none'); - for (const line of ['`printed: REVIEWED_TREE: ' + tree + ' ' + top + '`', `**Printed:** REVIEWED_TREE: ${tree} ${top}`]) { + for (const line of ['`printed: REVIEWED_TREE: ' + tree + ' ' + top + '`', `**Printed:** REVIEWED_TREE: ${tree} ${top}`, `**printed: REVIEWED_TREE: ${tree} ${top}**`]) { expect(checkReviewedTree(line, `${tree} ${top}`).ok, line).toBe(true); expect(checkReviewedTree(line.replace(tree, 'c'.repeat(40)), `${tree} ${top}`).ok, line).toBe(false); }