-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Labels
lang:mdxIssues affecting the MDX extension to Markdown (not general Markdown issues)Issues affecting the MDX extension to Markdown (not general Markdown issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 1.19.1
Playground link
--parser mdxInput:
import { Foo, Bar } from './Fixture'
# Hello, world!
<Foo bg='red'>
<div style={{ display: 'block'} }>
<Bar >hi </Bar>
</div>
</Foo>
Output:
SyntaxError: Unexpected closing tag "div". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (4:8)
2 |
3 | # Hello, world!
> 4 |
| ^
5 | <Foo bg='red'>
6 | <div style={{ display: 'block'} }>
7 | <Bar >hi </Bar>Expected behavior:
In prettier 1.18.2 this worked fine, but now it seems that the div tag is parsed as html (judging from the stack trace) and fails. The example above also renders correctly in the MDX playground at https://mdxjs.com/playground. Result JSX is:
<h1>{`Hello, world!`}</h1>
<Foo bg='red' mdxType="Foo">
<div style={{
display: 'block'
}}>
<Bar mdxType="Bar">hi </Bar>
</div>
</Foo>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:mdxIssues affecting the MDX extension to Markdown (not general Markdown issues)Issues affecting the MDX extension to Markdown (not general Markdown issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.