File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -175,11 +175,17 @@ class TokenizerState implements monacoNs.languages.IState {
175
175
}
176
176
177
177
function normalizeColor ( color : undefined ) : undefined
178
- function normalizeColor ( color : string ) : string
179
- function normalizeColor ( color : string | undefined ) : string | undefined
180
- function normalizeColor ( color : string | undefined ) : string | undefined {
178
+ function normalizeColor ( color : string | string [ ] ) : string
179
+ function normalizeColor ( color : string | string [ ] | undefined ) : string | undefined
180
+ function normalizeColor ( color : string | string [ ] | undefined ) : string | undefined {
181
+ // Some themes have an array of colors (not yet sure why), here we pick the first one
182
+ // https://github.com/shikijs/shiki/issues/894
183
+ // https://github.com/shikijs/textmate-grammars-themes/pull/117
184
+ if ( Array . isArray ( color ) )
185
+ color = color [ 0 ]
186
+
181
187
if ( ! color )
182
- return color
188
+ return undefined
183
189
184
190
color = ( color . charCodeAt ( 0 ) === 35 ? color . slice ( 1 ) : color ) . toLowerCase ( )
185
191
You can’t perform that action at this time.
0 commit comments