File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ async function getCodeFromActiveTab(): Promise<string | null> {
9898 }
9999 } ,
100100 ) ;
101- } ) ;
101+ } ) ;
102102 } ) ;
103103}
104104
@@ -109,9 +109,14 @@ function timeout(ms: number): Promise<never> {
109109}
110110
111111function formatResponseText ( text : string ) : string {
112+ // Get the current theme from the document attribute
113+ const isDarkTheme = document . documentElement . getAttribute ( 'data-theme' ) === 'dark' ;
114+ const complexityColor = isDarkTheme ? '#1abc9c' : '#0057b8' ; // teal vs rich blue
115+
112116 return text
113- . replace ( / t i m e / gi, '<span style="color: lightgreen;">time complexity</span>' )
114- . replace ( / s p a c e / gi, '<span style="color: lightgreen;">space complexity</span>' ) ;
117+ . replace ( / t i m e / gi, `<span style="color: ${ complexityColor } ; font-weight: bold;">time complexity</span>` )
118+ . replace ( / s p a c e / gi, `<span style="color: ${ complexityColor } ; font-weight: bold;">space complexity</span>` )
119+ . replace ( / O \( [ ^ ) ] + \) / g, `<span style="color: ${ complexityColor } ; font-weight: bold;">$&</span>` ) ;
115120}
116121
117122function stripMarkdownCodeBlock ( text : string ) : string {
You can’t perform that action at this time.
0 commit comments