Skip to content

Commit 53e89be

Browse files
authored
Preserve whether comment body is markdown string in replies (microsoft#158569)
Part of microsoft/vscode-pull-request-github#3776
1 parent 01063c2 commit 53e89be

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/vs/workbench/api/common/extHostComments.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function createExtHostComments(mainContext: IMainContext, commands: ExtHo
119119
return arg;
120120
}
121121

122-
const body = arg.text;
122+
const body: string = arg.text;
123123
const commentUniqueId = arg.commentUniqueId;
124124

125125
const comment = commentThread.getCommentByUniqueId(commentUniqueId);
@@ -128,7 +128,12 @@ export function createExtHostComments(mainContext: IMainContext, commands: ExtHo
128128
return arg;
129129
}
130130

131-
comment.body = body;
131+
// If the old comment body was a markdown string, use a markdown string here too.
132+
if (typeof comment.body === 'string') {
133+
comment.body = body;
134+
} else {
135+
comment.body.value = body;
136+
}
132137
return comment;
133138
}
134139

0 commit comments

Comments
 (0)