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

Adding newline in between frontmatter delimiters causes issues #10

Closed
aczw opened this issue Aug 2, 2024 · 5 comments
Closed

Adding newline in between frontmatter delimiters causes issues #10

aczw opened this issue Aug 2, 2024 · 5 comments

Comments

@aczw
Copy link

aczw commented Aug 2, 2024

Hi! Title says it all but when I try adding... any kind of newline in between the frontmatter delimiters (---), the syntax highlighting goes hay wire. I'm coming from MDX's VS Code extension. I've turned off all extensions except for MDX's and my theme.

  • MDX extension v1.8.9
  • VS Code 1.92.0

Without frontmatter:

image

With frontmatter, but empty:

image

With frontmatter and a newline:

image

With frontmatter and actual values:

image

Still occurs when I turn my theme off as well:

image

Please let me know how I can help. Thank you!

@wooorm
Copy link
Owner

wooorm commented Aug 2, 2024

Not reproducible on the demo here: https://wooorm.com/markdown-tm-language/.

I also don’t see it locally in VS Code with MDX.

Perhaps report this to the YAML grammar you use with VS Code. Looks like they mess up when there’s a

@wooorm
Copy link
Owner

wooorm commented Aug 2, 2024

/cc @remcohaszing who knows more about yaml and vs code than me :)

@remcohaszing
Copy link

remcohaszing commented Aug 2, 2024

Interesting 🤔

I am unable to reproduce this in my own VSCode setup. However, I am able to reproduce this with all extensions disabled. Installing the YAML extension resolves it.

This means it’s a bug with the builtin VSCode YAML grammar. The YAML extension uses its own grammar which isn’t broken.

Both VSCode and the YAML extension pull the YAML grammar from external sources, but not the same source. So really this is an issue with the external YAML grammar that VSCode uses.

TL;DR: It’s an issue in VSCode (microsoft/vscode#224862). As a workaround, install the YAML extension. It’s really good, you should use it anyway. :)

@wooorm wooorm closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2024
@aczw
Copy link
Author

aczw commented Aug 3, 2024

How bizarre! Installing the YAML extension did solve the issue, thank you.

@Firgrep
Copy link

Firgrep commented Aug 7, 2024

Also had this issue and the YAML extension resolved it! Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants