In VuePress using a component at the start of a new line in Markdown does not wrap the line in a <p> tag

35 Views Asked by At

Whether it's a built-in component like Badge or a custom component, if you start a new line with that component reference, the VuePress markdown parser does not treat it like a new paragraph.

This is text
 
<Badge text="TBD" /> foo

Gets rendered as...

<p>This is text</p>
<span class="badge">TBD</span> foo

But if you use it like this

This is text
 
foo <Badge text="TBD" /> bar

...it renders as...

<p>This is text</p>
<p>foo <span class="badge">TBD</span> bar</p>

Is there any way to force components to be rendered like any other text and be injected into a p tag if they are inline and at the start of a new line?

0

There are 0 best solutions below