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
232232
233233 const popupContents : ElementContent [ ] = [ ]
234234
235+ let lang = this . options . lang
236+ if ( lang === 'jsx' )
237+ lang = 'tsx'
238+ else if ( lang === 'js' || lang === 'javascript' )
239+ lang = 'ts'
240+
235241 const typeCode : Element = {
236242 type : 'element' ,
237243 tagName : 'code' ,
@@ -242,9 +248,7 @@ export function rendererRich(options: RendererRichOptions = {}): TwoslashRendere
242248 ...this . options ,
243249 meta : { } ,
244250 transformers : [ ] ,
245- lang : ( this . options . lang === 'tsx' || this . options . lang === 'jsx' )
246- ? 'tsx'
247- : 'ts' ,
251+ lang,
248252 structure : content . trim ( ) . includes ( '\n' ) ? 'classic' : 'inline' ,
249253 } ,
250254 ) . children as ElementContent [ ] ,
You can’t perform that action at this time.
0 commit comments