kentcdodds / mdx-bundler

🦤 Give me MDX/TSX strings and I'll give you back a component you can render. Supports imports!
MIT License
1.78k stars 75 forks source link

Question: how to skip generate a `p` element #150

Open willin opened 2 years ago

willin commented 2 years ago

such as an image block, it's wrapped with a div element... so that html generated is like:

<p>
    <div class="rc-image" style="width: 200px;">
        <img class="rc-image-img" src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" />
    </div>
</p>

how to skip the p element generation when there is a div?

dacohenii commented 2 years ago

Hey @willin, in case you still need an answer for this, I think the remark-unwrap-images plugin might do what you're looking for.