Skip to content

Commit 6b47d05

Browse files
authored
Suggested changes are not easily distinguishable (#5720)
* Suggested changes are not easily distinguishable Fixes #5667 * fix get suggestion
1 parent 7c8ca22 commit 6b47d05

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/github/prComment.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export class TemporaryComment extends CommentBase {
186186
}
187187
}
188188

189-
const SUGGESTION_EXPRESSION = /```suggestion(\r\n|\n)((?<suggestion>[\s\S]*?)(\r\n|\n))?```/;
189+
const SUGGESTION_EXPRESSION = /```suggestion(\u0020*(\r\n|\n))((?<suggestion>[\s\S]*?)(\r\n|\n))?```/;
190190

191191
export class GHPRComment extends CommentBase {
192192
public commentId: string;
@@ -291,7 +291,7 @@ export class GHPRComment extends CommentBase {
291291
get suggestion(): string | undefined {
292292
const match = this.rawComment.body.match(SUGGESTION_EXPRESSION);
293293
const suggestionBody = match?.groups?.suggestion;
294-
if (match?.length === 5) {
294+
if (match?.length === 6) {
295295
return suggestionBody ? `${suggestionBody}\n` : '';
296296
}
297297
}
@@ -305,7 +305,7 @@ export class GHPRComment extends CommentBase {
305305
return `***
306306
Suggested change:
307307
\`\`\`
308-
${args[2] ?? ''}
308+
${args[3] ?? ''}
309309
\`\`\`
310310
***`;
311311
});

0 commit comments

Comments
 (0)