showdownjs/showdown

markdown in html is jumping outside of the html element for custom elements

Open

#643 aperta il 22 gen 2019

Vedi su GitHub
 (2 commenti) (0 reazioni) (1 assegnatario)JavaScript (1640 fork)batch import
help wanted

Metriche repository

Star
 (13.700 star)
Metriche merge PR
 (Merge medio 15h 21m) (3 PR mergiate in 30 g)

Descrizione

<span markdown>
**test**

**test**
</span>

<div markdown>
**test**

**test**
</div>

<my-element markdown>
**test**

**test**
</my-element>

turns into

<p><span><strong>test</strong></span></p>
<p><strong>test</strong></p>
<div>
<p><strong>test</strong></p>
<p><strong>test</strong></p>
</div>
<p><span><my-element>test</strong></my-element></p>
<p><strong>test</strong></p>

So I'm assuming showdown is producing valid html, so it won't allow the block element inside the inline element.

But when I use a custom element and set it as a block element, I am still observing the same behaviour.

Is there a way to force showdown to treat it like a block element?

Guida contributor