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

Incorrect comments for ES syntaxes #221

Closed
JounQin opened this issue Aug 25, 2022 · 2 comments · Fixed by #317
Closed

Incorrect comments for ES syntaxes #221

JounQin opened this issue Aug 25, 2022 · 2 comments · Fixed by #317

Comments

@JounQin
Copy link
Member

JounQin commented Aug 25, 2022

I can confirm that the latest version v1.0.3 uses the correct syntax now when using the comment shortcut for embedded markdown:

{/* ## Headings */}

but it doesn't work on ESM import/exports or embedded JavaScript:

// export const foo = "bar";

Originally posted by @michaeloliverx in #203 (comment)

@JounQin
Copy link
Member Author

JounQin commented Aug 25, 2022

export const foo = "bar"; is recognized as ES module syntax, so its comments are // by default. It needs some kind of investigation.

cc @remcohaszing

Do you have any experience about this?

@remcohaszing
Copy link
Member

Unfortunately not. I added syntax highlighting for Monaco editor in microsoft/monaco-editor#3096. It doesn’t have this specific issues, but it does have some other issues and overall textmate is a more powerful format for syntax highlighting.

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.

2 participants