File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,12 @@ export function rendererRich(options: RendererRichOptions = {}): TwoslashRendere
232
232
233
233
const popupContents : ElementContent [ ] = [ ]
234
234
235
+ let lang = this . options . lang
236
+ if ( lang === 'jsx' )
237
+ lang = 'tsx'
238
+ else if ( lang === 'js' || lang === 'javascript' )
239
+ lang = 'ts'
240
+
235
241
const typeCode : Element = {
236
242
type : 'element' ,
237
243
tagName : 'code' ,
@@ -242,9 +248,7 @@ export function rendererRich(options: RendererRichOptions = {}): TwoslashRendere
242
248
...this . options ,
243
249
meta : { } ,
244
250
transformers : [ ] ,
245
- lang : ( this . options . lang === 'tsx' || this . options . lang === 'jsx' )
246
- ? 'tsx'
247
- : 'ts' ,
251
+ lang,
248
252
structure : content . trim ( ) . includes ( '\n' ) ? 'classic' : 'inline' ,
249
253
} ,
250
254
) . children as ElementContent [ ] ,
You can’t perform that action at this time.
0 commit comments