File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
src/vs/workbench/contrib/chat/browser/widget/chatContentParts Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -736,14 +736,16 @@ export class ChatQuestionCarouselPart extends Disposable implements IChatContent
736736 const isLong = messageContent . length > QUESTION_TITLE_TRUNCATION_THRESHOLD ;
737737 const renderTitle = ( expanded : boolean ) => {
738738 dom . clearNode ( title ) ;
739- const rawValue = isMarkdownString ( questionText ) ? questionText . value : questionText ;
740- const displayValue = ( isLong && ! expanded )
741- ? rawValue . slice ( 0 , QUESTION_TITLE_TRUNCATION_THRESHOLD ) . replace ( / \s + \S * $ / , '' ) + '…'
742- : rawValue ;
743- const suffixed = question . required ? `${ displayValue } *` : displayValue ;
744- const md = isMarkdownString ( questionText )
745- ? new MarkdownString ( suffixed , { isTrusted : questionText . isTrusted , supportThemeIcons : questionText . supportThemeIcons } )
746- : new MarkdownString ( suffixed ) ;
739+ const plainTextValue = isMarkdownString ( questionText ) ? renderAsPlaintext ( questionText ) : questionText ;
740+ const collapsedValue = isLong
741+ ? plainTextValue . slice ( 0 , QUESTION_TITLE_TRUNCATION_THRESHOLD ) . replace ( / \s + \S * $ / , '' ) + '…'
742+ : plainTextValue ;
743+ const md = expanded && isMarkdownString ( questionText )
744+ ? new MarkdownString (
745+ question . required ? `${ questionText . value } *` : questionText . value ,
746+ { isTrusted : questionText . isTrusted , supportThemeIcons : questionText . supportThemeIcons }
747+ )
748+ : new MarkdownString ( question . required ? `${ collapsedValue } *` : collapsedValue ) ;
747749 const rendered = questionRenderStore . add ( this . _markdownRendererService . render ( md ) ) ;
748750 title . appendChild ( rendered . element ) ;
749751 } ;
You can’t perform that action at this time.
0 commit comments