Question re interleaving #2038
-
Hello (again) 🙂 I have another question about interleaving. Specifically about content being wrapped in https://mdxjs.com/docs/what-is-mdx/#interleaving As I understand it, those docs say are saying that the determination on whether to wrap in Unfortunately most editors will automatically wrap long lines inside block level elements so this is not really practical. I had always thought markdown (and commonmark, so by extension MDX) did not do anything to content inside block elements embedded in markdown. The only way I have found to get around this is to wrap the entire I have looked through remark/rehype plugins for something that might allow me to do this, with no luck so far. Maybe a nice solution would be something in the MDX global options to disable parsing inside embedded HTML? This would also stop the hydration error when using Next.JS as you can end up with multiple nested <p> tags if you need to write the tag out manually - which is perfectly valid such as when class names are required. Thanks again! :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
Hi! You need to use Your understanding of those docs is correct. Your understanding of markdown and HTML blocks is also correct. MDX, as explained in the docs, deviates from that. Our users wanted interleaving. In your example, you are not using interleaving, and I believe that this fact, not using interleaving, makes the interleaving awkward.
You can style that There are several similar discussions. See also: #1798 and #1946. You can also configure your editor to not automatically wrap MDX. |
Beta Was this translation helpful? Give feedback.
Hi!
You need to use
`backticks`
in markdown on GitHub around HTML. Otherwise they’re treated as actual HTML.Your understanding of those docs is correct. Your understanding of markdown and HTML blocks is also correct. MDX, as explained in the docs, deviates from that. Our users wanted interleaving.
In your example, you are not using interleaving, and I believe that this fact, not using interleaving, makes the interleaving awkward.
You can style that
div
whatever way you want.I understand the theoretical need to style
<p>
s, but believe that in most cases you can instead style a<div>
around it, which is perhaps b…