martinheidegger / markdown-it-replace-link

markdown-it plugin for replacing links (image & text) in the markdown document.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML child rendering

noboevbo opened this issue · comments

I just stumbled around an issue with the rendering of mixed html code. So, for example, when processHTML is active and I add some html to a markdown file, like this:

<span class="test">abc</span>

it renders the children outside of the element, thus resulting in:

<span class="test"></span>abc

It seems, like this behavior is somehow expected, as you've included the following test case:

expect(md.render('<a href="hi"><img src="ho"></a>')).to.equal('<p><a href="http://me.com/hi"></a><img src="html-image/ho"></p>\n')

Is this also an issue with the test or is it actual expected behavior? It seems to only affect html_inline, as closes the html tag always in child 1 (probably due to the Dom rendering the "incorrect" unclosed element closed).