question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mdx v2: New line inside DOM element (jsx) creates unnecessary paragraph

See original GitHub issue

New line inside DOM element (jsx) creates unnecessary paragraph

Steps to reproduce

in playground editor, input the following

<p>
  Hello world
</p>
<div>
  <span>
    one
  </span>
  <span>
    two
  </span>
</div>

Expected compiled result

<p>
  Hello world
</p>
<div>
  <span>
    one
  </span>
  <span>
    two
  </span>
</div>

Actual compiled result

<p>
  <p>
    Hello world
  </p>
</p>
<div>
  <span>
    <p>
      one
    </p>
  </span>
  <span>
    <p>
      two
    </p>
  </span>
</div>

this ends up being invalid HTML

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:26 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
wooormcommented, Nov 5, 2021

This is expected behavior. It’s different from before, but I believe the new rules are in the end more sensical than the previous rules. See Interleaving and Migrating

1reaction
ksinascommented, Nov 11, 2021

I hear what you’re saying. Thanks for the discussion. I understand that the option I would be interested in will not be implemented, so you can close the issue.

Anyway, thanks for the great work!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Composing Documents with MDX: Markdown for the ...
In this tutorial, we'll create React UI components and MDX markdown components, to compose and style a markdown document.
Read more >
MDX and React - Docusaurus
Docusaurus has built-in support for MDX v1, which allows you to write JSX within your Markdown files and render them as React components....
Read more >
Adjacent JSX elements must be wrapped in an enclosing tag ...
The other people here are just telling you to use a parent element, but that may be unnecessary. This older version of your...
Read more >
Untitled
Example of creating a button with a line break by using the tag: Oct 7, 2021 I'm using react-highlight-words library. Start using react-newline-to-break...
Read more >
Hands-On way to build Frontend with React | Nick Ovchinnikov
I would like to open a completely new way to manage you. ... In D5W header image it just the elements inside react,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found