Is a correct HTML document also a correct MDX document? #1680
-
Let's say we have an MDX file with the following contents: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>My first HTML document</TITLE>
</HEAD>
<BODY>
<P>Hello world!
</BODY>
</HTML> Would that be a correct MDX document? If not, what is preventing it from it? I know that single MDX files are typically part of larger DOM structure, so embedding this in a JSX file and then actually rendering would result in an incorrect HTML document (that is, having |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
No.
It would not be.
MDX the language is Markdown - HTML + JSX.
It sounds like you are interested in mixing markdown and HTML? In the future MDX the library may include a mode where it can be switched to parse plain markdown. |
Beta Was this translation helpful? Give feedback.
No.
It would not be.
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):
className
attribute to add CSS classes, HTML usesclass
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…