mdx-js / mdx-analyzer

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

Indentation in code blocks breaks syntax highlighting #472

Closed alexisintech closed 1 week ago

alexisintech commented 3 weeks ago

Initial checklist

Affected packages and versions

unifiedjs.vscode-mdx v1.8.10

Link to runnable example

No response

Steps to reproduce

  1. Create a new MDX file in VS Code
  2. Copy the following code in to the document:

    ```js
    console.log('hi')
    console.log('hi2')

Expected behavior

Code blocks should have correct syntax highlighting, as shown in the following image

Screenshot 2024-08-23 at 14 08 12

Actual behavior

When indented, the syntax highlighting breaks after the end of the first code block (the last triple backtick ```)

Screenshot 2024-08-23 at 14 08 04

Runtime

Other (please specify in steps to reproduce)

Package manager

No response

OS

macOS

Build and bundle tools

No response

wooorm commented 2 weeks ago

weird, cannot reproduce on https://wooorm.com/markdown-tm-language/, but can indeed reproduce in VS Code with this extension.

remcohaszing commented 2 weeks ago

The issue also appears on the markdown-tm-language playground. The version hosted on https://wooorm.com/markdown-tm-language/ is outdated.

Screenshot of the `markdown-tm-language` playground with the issue reproduced

The version on https://mdxjs.com/playground/ also uses an outdated grammar where the issue can’t be reproduced.

The issue is reproducible on https://shiki.style/.

github-actions[bot] commented 2 weeks ago

Hi! This was marked as ready to be worked on! Note that while this is ready to be worked on, nothing is said about priority: it may take a while for this to be solved.

Is this something you can and want to work on?

Team: please use the area/* (to describe the scope of the change), platform/* (if this is related to a specific one), and semver/* and type/* labels to annotate this. If this is first-timers friendly, add good first issue and if this could use help, add help wanted.

wooorm commented 1 week ago

ok, think I have it

github-actions[bot] commented 1 week ago

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

github-actions[bot] commented 1 week ago

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