Skip to content

Text inside <pre> in custom component is stripped out of newline characters #2414

Answered by wooorm
glothriel asked this question in General
Discussion options

You must be logged in to vote

What you see for the regular pre is how mdx interleaves: nicely. You can put nlthings in it. It follows markdown

What you see with the early pre is how javascript and jsx work. Those braces enter javascript. Theres no markdown in there. If you'd use js(x) in TS or Babel or Esbuild or whatever, it'll be the exact same.
So: how do you solve this in js(x)? With {'\n'}.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by glothriel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants