vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

Markdown syntax incorrectly being processed in inline HTML #96

Closed dkharrat closed 12 years ago

dkharrat commented 12 years ago

I've been using the the Redcarpet library and noticed that Markdown syntax is incorrectly being processed in inline HTML. For example, this:

<div>
    <div>
        <p>this is paragraph one</p>
    </div>

    <div>
        <p>this is paragraph two</p>
    </div>
</div>

is turned into:

<div id="article_body">
  <div>
    <div>
        <p>this is paragraph one</p>
    </div>

    <pre><code>
&lt;div&gt;
&lt;p&gt;this is paragraph two&lt;/p&gt;
&lt;/div&gt;
    </code></pre>

<p></p>
</div><p></p>

</div>

Basically, it's processing the the indentation as a pre block. The correct behavior should be that Markdown sytax is not processed until the first opening inline HTML tag is closed.

vmg commented 12 years ago

Gotcha. Sorry that this got stalled -- there's something fundamentally wrong in the way that code blocks get handled. This will require a small rewrite. I'm on it!

vmg commented 12 years ago

Fixed! Thanks for spotting this nasty bug. Can you confirm that this is working for you?

dkharrat commented 12 years ago

Yay! It's working now. Thanks for fixing it, and for providing this awesome gem!