44 *--------------------------------------------------------------------------------------------*/
55
66import * as nodePath from 'path' ;
7+ import * as marked from 'marked' ;
78import vscode from 'vscode' ;
89import { parseSessionLogs , parseToolCallDetails , StrReplaceEditorToolData } from '../../../common/sessionParsing' ;
910import { COPILOT_SWE_AGENT } from '../../common/copilot' ;
@@ -13,6 +14,7 @@ import { toOpenPullRequestWebviewUri } from '../../common/uri';
1314import { InMemFileChangeModel , RemoteFileChangeModel } from '../../view/fileChangeModel' ;
1415import { AssistantDelta , Choice , ToolCall } from '../common' ;
1516import { CopilotApi , SessionInfo } from '../copilotApi' ;
17+ import { PlainTextRenderer } from '../markdownUtils' ;
1618import { PullRequestModel } from '../pullRequestModel' ;
1719
1820export class ChatSessionContentBuilder {
@@ -57,7 +59,9 @@ export class ChatSessionContentBuilder {
5759 // if this is the first response, then also add the PR card
5860 if ( history . length === 1 ) {
5961 const uri = await toOpenPullRequestWebviewUri ( { owner : pullRequest . remote . owner , repo : pullRequest . remote . repositoryName , pullRequestNumber : pullRequest . number } ) ;
60- const card = new vscode . ChatResponsePullRequestPart ( uri , pullRequest . title , pullRequest . body , pullRequest . author . specialDisplayName ?? pullRequest . author . login , `#${ pullRequest . number } ` ) ;
62+ const plaintextBody = marked . parse ( pullRequest . body , { renderer : new PlainTextRenderer ( ) , } ) . trim ( ) ;
63+
64+ const card = new vscode . ChatResponsePullRequestPart ( uri , pullRequest . title , plaintextBody , pullRequest . author . specialDisplayName ?? pullRequest . author . login , `#${ pullRequest . number } ` ) ;
6165 const cardTurn = new vscode . ChatResponseTurn2 ( [ card ] , { } , COPILOT_SWE_AGENT ) ;
6266 history . push ( cardTurn ) ;
6367 }
0 commit comments