question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Syntax highlighting stops working when indented

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:5

github_iconTop GitHub Comments

2reactions
vecerekcommented, 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
0reactions
eXifreXicommented, Nov 27, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Syntax highlighting and indentation not working at the end of a ...
If syntax highlighting or indentation suddenly stops working as expected at some point in your buffer/file, there's a very good chance you ...
Read more >
Syntax highlighting not working at high indentation levels : r/vim
Hello,. I've found that my markdown and spelling syntax highlighting do not work when I have more than two tabs on a line....
Read more >
Syntax highlight breaks when Bash heredocument delimiter is ...
Syntax highlight breaks when Bash heredocument delimiter is indented: Indented. indented. Not indented. not indented. Why this phenomenon shouldn't happen.
Read more >
Bug: Code editor syntax highlighting and auto-indent
In most cases, the auto-indentation and the syntax highlighting works as intended/expected, such as when typing if <some expression> then ...
Read more >
Dockerfile sintax highlight doesn't work on 4-space-indented ...
I indent with 4 spaces all instructions (except FROM) in my Dockerfile, ... But in visual studio, when I do this, the syntax...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found