How to <pre> without <p> #2620
Unanswered
TellowKrinkle
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Markdown allows embedding HTML. MDX allows embedding JSX. These are two different things. On top of that, MDX allows passing MDX as JSX children. You’re passing a markdown paragraph, that’s where the As a workaround, you can avoid passing markdown constructs as JSX children: <pre>
{' 1.44×10'}<sup>40</sup>
{'+ 2.25×10'}<sup>40</sup>
</pre> Or you can completely disable MDX constructs leveraging a JSX expression: {
<pre>
{' 1.44×10'}<sup>40</sup>
+ 2.25×10<sup>40</sup>
</pre>
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If I do something like
MDX wraps the contents of the pre in a
<p>
, which ends up leaving an extra blank line at the end of the block.The answer to #2194 recommends putting {}s around the block, but if I do that, all the newlines are deleted.
The goal is to get something that looks like this:
Here on GitHub, I can easily do that with this (and it even looks readable in the source, unlike the above)
Beta Was this translation helpful? Give feedback.
All reactions