threepointone/markdown-in-js

How to interpolate block-level components?

Opened this issue · 0 comments

Willing to come up with a PR if there are any ideas around how this API would work.

Right now my workaround is to wrap the interpolated component with a <div> so that it will render inside a div rather than a p.

markdown`
<div>
${<MyBlockLevelComponent />}
</div>
`

I'm wondering if there is a way to "detect" the tag name of the rendered component, or if we need to rely on an option passed into the markdown function, such as markdown({nowrap: [MyBlockLevelComponent]})