Error "Unexpected character !" from remark when parsing HTML comment
#11152
-
|
I'm trying to use Vale in a Docusaurus project. It works well, but if I need to add a special Vale comment like I have a build step that checks my markdown files by running Any idea how to resolve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
You need to either switch to the CommonMark processor (https://docusaurus.io/docs/markdown-features#mdx-vs-commonmark), or use the MDX comment: |
Beta Was this translation helpful? Give feedback.

MDX v2/v3 doesn't support html comments anymore (but MDX v1 did):
https://mdxjs.com/playground/
Normally Docusaurus v3 has a compat layer to still allow HTML comments in MDX docs, even without CommonMark mode. In this case, we add this remark plugin automatically: https://github.com/leebyron/remark-comment
I tried the
<!-- vale off -->comment and it definitely works, so @emertechie if it's your Docusaurus site failing, please provide a repro where we can see the error in action.Remember that you can disable this compat layer so make sure you didn't do that: https://docusaurus.io/blog/releases/3.0#markdown