Skip to content

Why was the support for <-- comments removed? #2219

Answered by wooorm
ovflowd asked this question in Q&A
Discussion options

You must be logged in to vote

extremely painful

Use a regex to replace <!-- with {/* and --> with */}, or a plugin, or use the .md extension if you want markdown.

randomly decide

No, it was a very careful decision to make what is markdown and what is JS(X) unambiguous. If you want to migrate from markdown, you don’t need to migrate, use an .md extension.

genuinely curious

"compatibility" plugins/options

a) there is a plugin.
b) because MDX before v2 passed everything that looked like XML through as JS(X) to Babel/Webpack. We can’t codemod that. We can’t support that. From v2 on, we have an actual AST, which can be transformed, so we can do that.

Replies: 2 comments 19 replies

Comment options

You must be logged in to vote
1 reply
@ovflowd
Comment options

Answer selected by ovflowd
Comment options

You must be logged in to vote
18 replies
@ovflowd
Comment options

@remcohaszing
Comment options

@ovflowd
Comment options

@ovflowd
Comment options

@remcohaszing
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants