Lately I've noticed the syntax highlighting for typescript questions is not applying when the code fence hint
```ts
or
```lang-ts
is used.
Example question - How to have TypeScript show computed/simplified type
The question (at the time of posting) is tagged correctly and also uses code fences
```ts
export type UnionExpanded<$Union> = $Union
export type HandleReturn2<$Data> = UnionExpanded<$Data | 2>
```
Using lang-ts
also fails but updating even one code fence to use lang-typescript
seems to fix all code blocks.
Removing the hint and letting the tag take priority also works.
This always used to work and is also listed in What is syntax highlighting and how does it work?
- TypeScript:
lang-typescript
, (lang-ts
,lang-tsx
,lang-mts
,lang-cts
)
ts
andlang-ts
even recognized? The name of the tag istypescript
, and the tag wiki indicates that the syntax highlighting language islang-js
, notlang-ts
.lang-ts
is officially supported.ts
isn't a synonym fortypescript
, though - why did that one used to work?typescript
to pull in the JavaScript highlighting orlang-typescript
will (should) function as expected. Somewhat relatedly, with the new behaviour, it might also be time to take a second look at Change Default Syntax Highlighting for [typescript] from lang-js to lang-typescript