File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -157,9 +157,7 @@ fn process_message<'a>(
157
157
lines. push ( line) ;
158
158
if is_opened {
159
159
// TODO: code highlight
160
- lines. extend (
161
- ratskin. parse_text ( & format ! ( "```\n {}\n ```" , content) , width) ,
162
- ) ;
160
+ lines. extend ( ratskin. parse_text ( & content, width) ) ;
163
161
}
164
162
}
165
163
}
@@ -188,7 +186,7 @@ fn process_message<'a>(
188
186
let mut line = role_prefix ( "Assistant" , theme. assistant ) ;
189
187
let parts =
190
188
// add space prefix to correct first line with wrapping
191
- ratskin. parse_text ( & format ! ( " {}" , & text) , width) ;
189
+ ratskin. parse_text ( & format ! ( "Assistant: {}" , & text) , width) ;
192
190
if let Some ( first_line) = parts. first ( ) {
193
191
let mut spans = first_line
194
192
. spans
@@ -197,11 +195,9 @@ fn process_message<'a>(
197
195
. enumerate ( )
198
196
. map ( |( i, s) | {
199
197
if i == 0 {
200
- s. clone ( )
201
- . style ( theme. text_style ( ) )
202
- . content ( s. content . trim ( ) . to_string ( ) )
198
+ s. clone ( ) . content ( s. content [ 10 ..] . to_string ( ) )
203
199
} else {
204
- s. style ( theme . text_style ( ) )
200
+ s
205
201
}
206
202
} )
207
203
. collect :: < Vec < _ > > ( ) ;
You can’t perform that action at this time.
0 commit comments