Unnecessary <p>...</p>s are inserted to every top-level HTML literal
See original GitHub issueMDX (2.0.0-next.8) adds unnecessary p
layers as
Input
<h1>Title</h1>
<p>Text</p>
Output
<h1><p>Title</p></h1>
<p><p>Text</p></p>
This will break styles and some React components that take children.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (3 by maintainers)
Top Results From Across the Web
HTML Standard
Presentational markup tends to be much more redundant, and thus results in ... A literal U+0050 LATIN CAPITAL LETTER P character followed by...
Read more >PythonTA Checks
This error occurs when code statements are placed in the top level. The type of statements allowed in the top level are imports,...
Read more >HTML 5.3
Abstract. This specification defines the 5th major version, third minor revision of the core language of the World Wide Web: the Hypertext ...
Read more >CL-WHO - Yet another Lisp markup language
If prologue is T the prologue string is the value of *PROLOGUE* . CL-WHO will usually try not to insert any unnecessary whitespace...
Read more >Chapter 2 Manipulate HTML tags from R with {htmltools}
Inside the function call, all named elements become attributes, whereas unnamed elements become children. In some cases, tags may have empty attributes like...
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
IMO this behaviour should not require a plugin to fix it, it shouldn’t happen at all. @wooorm are you saying that this is correct parsing?
Seems the
<p>
- inserting rule has changed since 2.0.0-next.9.PS
No, the truth is that the parser has moved to mdast-util-mdx-jsx and the names of nodes of AST have also changed:
mdxBlockElement
tomdxJsxFlowElement
mdxAttribute
tomdxJsxAttribute