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

Cannot parse markdown comments #277

Closed
vitonsky opened this issue May 22, 2022 · 3 comments
Closed

Cannot parse markdown comments #277

vitonsky opened this issue May 22, 2022 · 3 comments

Comments

@vitonsky
Copy link

Steps to reproduce

Try to compile this text

Some text
<!-- md comment -->

Expected behavior

Text compiled successfully

Actual behavior

Error

Unexpected character `!` (U+0021) before name, expected a character that can start a name, such as a letter, `$`, or `_` (note: to create a comment in MDX, use `{/* text */}`)

Notes

This is easy to fix, we have to apply https://www.npmjs.com/package/remark-comment plugin.
Author say "This plugin must be added after MDX, otherwise you will see this error" but we can't apply it before MDX at this time on user side

@BRKalow
Copy link
Contributor

BRKalow commented May 29, 2022

So effectively you're looking for a way to apply a remark plugin before mdx attempts to parse the source, right? I'm not sure if @mdx-js/mdx supports this out of the box 🤔

@vitonsky
Copy link
Author

@leebyron what you think about it? Is it possible to enable md comments for mdx?

@BRKalow
Copy link
Contributor

BRKalow commented Feb 11, 2023

I'm going to close this out as I don't think this issue is specific to next-mdx-remote, as MDX v2 does not support HTML comment syntax.

@BRKalow BRKalow closed this as completed Feb 11, 2023
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

2 participants