mdx-js / mdx-analyzer

MDX extension for Visual Studio Code

Home Page:https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yesterday's release broke some mdx syntax highlighting for me

kentcdodds opened this issue · comments

Initial checklist

Affected packages and versions

vscode-mdx

Link to runnable example

No response

Steps to reproduce

Install the latest version of vscode-mdx
Open a markdown file with some markdown, even simple markdown will do. Here are some examples:

# Hello world

This **should** be highlighted

image

import Comp from './comp'

<Comp prop={34} prop2="hi">
  This: `should be syntax highlighted`.
</Comp>

image

## This should be highlighted

And _this_ should be too...

image

This is a list:

- why
- are
- these
- hyphens
- green?

No big deal, just kinda surprised...

image

Expected behavior

Things like headings, strong, italics, and inline code blocks should be highlighted.

Actual behavior

The colors are either non-existent or different from what I was used to before. The components look great though 👍

I'm using Night Owl, but these behaviors show up in others as well. I guess what I would really like is if my MDX highlighting looked as close to the regular markdown highlighting as possible.

Here's what the examples above look like with regular markdown highlighting in Night Owl:

image

image

(Yeah, MDX does better on this one for sure)

image

image

This could just be a case of "someone moved my cheese," but I do think there could be something wrong with the highlighting of the headings, strong, italics, and text in the back-tics.

Thanks!

Runtime

Node v18

Package manager

npm v9

OS

macOS

Build and bundle tools

No response

commented

Hi Kent! Thanks for taking the time to test it out and provide feedback!

I’m going to move this to https://github.com/wooorm/markdown-tm-language. That’s where the code is. This grammar will also be used in other places, with other users, so it’s useful to have the discussions there.
There’s also a demo there: https://wooorm.com/markdown-tm-language/. Which is useful to compare. Because everyone’s themes are different.

I’m closing this issue in favor of the upstream one.