Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlighting stops working when indented #209

Closed
4 tasks done
cibulka opened this issue Jul 30, 2022 · 5 comments · Fixed by #317
Closed
4 tasks done

Syntax highlighting stops working when indented #209

cibulka opened this issue Jul 30, 2022 · 5 comments · Fixed by #317

Comments

@cibulka
Copy link

cibulka commented Jul 30, 2022

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

@kolodziejczak-sz
Copy link

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

@darrenbarklie
Copy link

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

@cibulka
Copy link
Author

cibulka commented Nov 2, 2022

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

@vecerek
Copy link

vecerek commented Nov 5, 2022

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

@eXifreXi
Copy link

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

wooorm added a commit that referenced this issue Mar 21, 2023
This now pulls in a grammar for from:
<https://github.com/wooorm/markdown-tm-language>.

It fixes a bunch of previous errors and adds real support for MDX.
It also supports YAML frontmatter, TOML frontmatter, GFM (autolink
literals, footnotes, strikethrough, tables, tasklists), GitHub (gemoji,
mentions, references).
There’s support for about 20 common embedded grammars in fenced code
blocks.
Embedded code (in fenced code blocks, or in ESM/expressions) is now
marked as being the correct language, which makes comments and such
work.

Closes GH-183.
Closes GH-191.
Closes GH-209.
Closes GH-221.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

5 participants