showdownjs/showdown

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

開放

#643 建立於 2019年1月22日

 (2 則留言) (0 個反應) (1 位負責人)JavaScript (1,640 個分叉)batch import
help wanted

倉庫指標

星標
 (13,700 顆星)
PR 合併指標
 (平均合併 15小時 21分鐘) (30 天內合併 3 個 PR)

描述

<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?

貢獻者指南