Skip to content

Is a correct HTML document also a correct MDX document? #1680

Discussion options

You must be logged in to vote

Is a correct HTML document also a correct MDX document?

No.

Would that be a correct MDX document?

It would not be.

If not, what is preventing it from it?

MDX the language is Markdown - HTML + JSX.
While JSX looks similar and sometimes identical to HTML.
JSX differs from HTML in a number of ways.
Including (but not limited to):

  • JSX uses stricter XML style parsing
  • JSX does not support doctype
  • JSX is case sensitive, HTML is not
  • JSX uses the className attribute to add CSS classes, HTML uses class

It sounds like you are interested in mixing markdown and HTML?
If so, good news, markdown itself supports this.
remark the underlying library which mdx extends can do this.
There's a guide o…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants