From 53e89be20381eb4cb7c4541b9f6a3d8b4502a94e Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Fri, 19 Aug 2022 12:24:01 +0200 Subject: [PATCH] Preserve whether comment body is markdown string in replies (#158569) Part of microsoft/vscode-pull-request-github#3776 --- src/vs/workbench/api/common/extHostComments.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/api/common/extHostComments.ts b/src/vs/workbench/api/common/extHostComments.ts index 226c3d0dc12..0c757e5ccdd 100644 --- a/src/vs/workbench/api/common/extHostComments.ts +++ b/src/vs/workbench/api/common/extHostComments.ts @@ -119,7 +119,7 @@ export function createExtHostComments(mainContext: IMainContext, commands: ExtHo return arg; } - const body = arg.text; + const body: string = arg.text; const commentUniqueId = arg.commentUniqueId; const comment = commentThread.getCommentByUniqueId(commentUniqueId); @@ -128,7 +128,12 @@ export function createExtHostComments(mainContext: IMainContext, commands: ExtHo return arg; } - comment.body = body; + // If the old comment body was a markdown string, use a markdown string here too. + if (typeof comment.body === 'string') { + comment.body = body; + } else { + comment.body.value = body; + } return comment; }