markdown-tm-language icon indicating copy to clipboard operation
markdown-tm-language copied to clipboard

Upstream TS grammar bug: No semicolon after a `type` leads to embedded TS running amok

Open wooorm opened this issue 2 years ago • 1 comments

Example:

# Dark blue?

```js
type X = 1
```

# Dark blue?

```ts
type X = 1
```

# Dark blue?

The bug is tracked at https://github.com/microsoft/TypeScript-TmLanguage/issues/873. It affects this grammar when used on GH only when using ```ts. It affects this grammar when used in VS code everywhere.

The actual solution is upstream, but tracking it here as users might run into it. In the mean time, add a semicolon :'(

# Dark blue?

```ts
type X = 1;
```

# Dark blue?

wooorm avatar Jun 20 '23 14:06 wooorm

note: this is issue is not present in VSCode because VSCode's while is a lot more strict than Github's/TextMate's so embedded languages are unable to break out of the codeblock's while https://github.com/microsoft/vscode-markdown-tm-grammar https://github.com/microsoft/vscode-textmate/issues/241

RedCMD avatar May 03 '25 21:05 RedCMD