Errors with some HTML snippets with tags (mdx 1.6.22) #1568
-
Is this reasonable? CasesOK<div>
{a: 0}
</div> => OK NG<div>
{a: 0}
</div> => SyntaxError: No-Inline evaluations must call EnvThere is no differences in the following test environments:
|
Beta Was this translation helpful? Give feedback.
Answered by
ChristianMurphy
Jun 1, 2021
Replies: 1 comment 1 reply
-
It is, in MDX 1 an empty newline inside a JSX block allows non-JSX content to be mixed in. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ChristianMurphy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is, in MDX 1 an empty newline inside a JSX block allows non-JSX content to be mixed in.
In the first example, the JSX block has switched back to markdown, where
{a: 0}
is interpreted as plain text.In the second example, the content is still inside JSX, and is interpreted as a JSX expression, and
a: 0
is invalid JS/JSX.