Support Markdown in nested HTML
See original GitHub issueSubject of the issue
Currently, MDX crashes on Markdown in nested HTML. Example:
<div>
* list
</div>
Works.
<div>
<div>
* list
</div>
</div>
Crashes! Resulting in something like:
error UNHANDLED REJECTION
SyntaxError: unknown: Expected corresponding JSX closing tag for <MDXTag> (30:0)
28 | <MDXTag name="li" components={components} parentName="ul">
29 | <MDXTag name="p" components={components} parentName="li">{`list`}</MDXTag>
> 30 | </div>
| ^
31 | </MDXTag>
32 | </MDXTag>
33 | </div>
This makes it impossible to use Markdown in a table, since you need to nest some table
, tr
, and td
tags in HTML.
Your environment
Tried with the create-react-app
example:
"mdx.macro": "^0.2.8",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"react-scripts": "2.1.8"
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Markdown in nested divs not being processed - Stack Overflow
However, the markdown isn't being processed here. It doesn't seem to work in nested HTML blocks. Single level blocks will work: <div markdown= ......
Read more >Markdown Tutorial - Nested Lists - CommonMark
To nest one list within another, indent each item in the sublist by four spaces. You can also nest other elements like paragraphs,...
Read more >Basic Syntax - Markdown Guide
If your Markdown application supports HTML, you can use the <br> HTML tag. ... Indent one or more items to create a nested...
Read more >Markdown in nested shortcodes - support - HUGO
Runs the provided string through the Markdown processor. ... Currently I rewrote my templates and shortcodes with more HTML to accommodate this limitation....
Read more >Little Stuff about Markdown I Always Forget and have to Google
There is no concept of a <div> in Markdown syntax (or most other structural HTML elements), except that Markdown supports HTML so you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Undistraction I think that’s already supported. But you need to add a space:
@johno Do you plan to support Markdown in only HTML:
or inside a Component?