mdx-js / mdx-analyzer

MDX extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx
MIT License
351 stars 21 forks source link

Syntax highlighting breaks when anything is after `{}` #480

Closed KianNH closed 2 months ago

KianNH commented 2 months ago

Initial checklist

Affected packages and versions

unifiedjs.vscode-mdx v1.8.10

Link to runnable example

No response

Steps to reproduce

Paste the following snippets into separate MDX files:

{props.name}

```js
export const foo = "bar";

foo


````mdx
{props.name} a

```js
export const foo = "bar";

foo



It looks like this can also be reproduced with GitHub's highlighting, so maybe it's an issue with the grammar?

### Expected behavior

Both should have the same syntax highlighting.

### Actual behavior

The second one, with a character after the brackets, has broken syntax highlighting.

### Runtime

Node v21

### Package manager

_No response_

### OS

_No response_

### Build and bundle tools

_No response_
wooorm commented 2 months ago

Thanks! I think I have it.

sebas1208 commented 2 months ago

I found a probably related issue with code blocks inside JSX components.

image

the closing tag is still recognized as ruby code.

github-actions[bot] commented 2 months ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

remcohaszing commented 2 months ago

I found a probably related issue with code blocks inside JSX components.

That was a duplicate of #472, which was already resolved, but not yet released.