0

Possible Duplicate:
Markdown formatting bug with code blocks in lists

Consider the following Markdown input:

1. Blah

        void Main()
        {
            Line 1

            Line 2

Actual behaviour: This is currently rendered into the following HTML. I have removed the <span> and <code> tags that pertain to the syntax highlighting, the outer <ol> tag, and I have indented it to make the bug more obvious. Notice that there is a <pre> nested inside another <pre>:

<li>
    <p>Blah</p>
    <pre class="prettyprint">
        void Main()<br>
        {<br>
        &nbsp; &nbsp; Line 1<br>
        <br>
        <br>
        <pre class="prettyprint">
            Line 2<br>
        </pre>
        <br><br>
    </pre>
</li>

Expected behaviour is something more like this:

<li>
    <p>Blah</p>
    <pre class="prettyprint">
        void Main()<br>
        {<br>
        &nbsp; &nbsp; Line 1<br>
        <br>
        &nbsp; &nbsp; Line 2
    </pre>
</li>

marked as duplicate by Jeff Atwood Aug 25 '10 at 7:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged .