mdx-analyzer icon indicating copy to clipboard operation
mdx-analyzer copied to clipboard

Syntax highlighting stops working when indented

Open cibulka opened this issue 3 years ago • 2 comments

Initial checklist

Affected packages and versions

VSCode MDX v0.3.2

Link to runnable example

No response

Steps to reproduce

Use the attached MDX file in archive in VSCode 1.69.2 with VSCode MDX v0.3.2.

vscode-mdx-indent-test.mdx.zip

Expected behavior

Syntax highlighting should preferably happen at all times, meaning:

  1. if inside wrapper (either indented or not)
  2. if indented

If the markdown usage of tabs conflicts with this, then at least the wrappers should work.

Actual behavior

First of all, thanks for a cool extension!

It stops working for me however when it is indented and/or wrapped in another element.

Here's the MDX in question (I've attached the file above):

## Heading highlighted

<Wrapper>
    ## Heading not highlighted 
    - List item 1 
    - List item 2
</Wrapper>

    ## This is also not highlighted

<Wrapper>
## Neither is this
</Wrapper>

Screenshot 2022-07-30 at 18 45 18

I use a lot of wrappers in my MDX files, so this sort of breaks the extension for me...

Runtime

No response

Package manager

No response

OS

macOS

Build and bundle tools

No response

cibulka avatar Jul 30 '22 16:07 cibulka

I'm also struggling with this error, MDX v1.0.2: vscode-mdx-bug

kolodziejczak-sz avatar Aug 20 '22 10:08 kolodziejczak-sz

Similar issue for me in authoring MDX for Astro.

image

Oddly, if I indent the HTML, the MD highlighting returns, though I'm not suggesting this as a workaround. :)

image

darrenbarklie avatar Sep 09 '22 10:09 darrenbarklie

Is there any progress with this? I think it's a pretty crucial thing to fix. :(

cibulka avatar Nov 02 '22 13:11 cibulka

Same here (using v1.0.3):

No-indent "workaround":

Screenshot 2022-11-06 at 02 15 08

With indent "workaround":

Screenshot 2022-11-06 at 02 15 49

vecerek avatar Nov 05 '22 15:11 vecerek

I can also confirm the exact behavior as outlined above. Would love to know if there is a solution to this or if peeps are even properly aware of it. (:

It doesn't even need opening and closing tags to be indented. As soon as the opening tag is not indented it starts failing to highlight the inner markdown. Doesn't seem to break everything though, as HTML is still working fine.

image image

eXifreXi avatar Nov 27 '22 15:11 eXifreXi