Skip to content

How can I wrap top-level components in paragraph tags? #2232

Answered by ChristianMurphy
timbasel asked this question in Q&A
Discussion options

You must be logged in to vote

Is there a way for me to make mdx respect the markdown structure for top-level single components, i.e. wrap them in a

when they are seperated by an empty line?

This is the intended behavior, you can see the past discussions on this for the reasoning https://github.com/orgs/mdx-js/discussions?discussions_q=block+inline
And some annotated examples in https://github.com/orgs/mdx-js/discussions/2194#discussioncomment-4357673

How can I wrap top-level components in paragraph tags?

A few ways, without any changes to mdx you can add the paragraph JSX tags where you want them

import { Quote } from "~/components/dialog"

Lorem ipsum dolor sit amet, <Quote>consetetur sadipscing elitr, sed diam …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@wooorm
Comment options

@timbasel
Comment options

Answer selected by timbasel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants