Skip to content

definition lists containing multi-paragraph ordered lists rendered as code #918

Closed
@aronatkins

Description

@aronatkins

Given Markdown with a definition list that contains an ordered list and the ordered list has multi-paragraph elements, each ordered list element is rendered as a separate ordered list and the paragraphs are rendered as code blocks.

This appears specific to definition lists (using def_list). It does not appear that other types of lists make a similar formatting decision for multi-paragraph sub-lists.

The markdown input:

term

:   this is a definition for term. it has 
    multiple lines in the first paragraph.

    1.  first thing
    
        first thing details in a second paragraph.
        
    1.  second thing

        second thing details in a second paragraph.

    1.  third thing

        third thing details in a second paragraph.

Expected:

<dl>
<dt>term</dt>
<dd>
<p>this is a definition for term. it has
multiple lines in the first paragraph.</p>

<ol>
<li>first thing
<p>first thing details in a second paragraph.</p>
</li>

<li>second thing
<p>second thing details in a second paragraph.</p>
</li>

<li>third thing
<p>third thing details in a second paragraph.</p>
</li>
</ol>

</dd>
</dl>

Actual:

<dl>
<dt>term</dt>
<dd>
<p>this is a definition for term. it has
multiple lines in the first paragraph.</p>
<ol>
<li>first thing</li>
</ol>
<pre><code>first thing details in a second paragraph.
</code></pre>
<ol>
<li>second thing</li>
</ol>
<pre><code>second thing details in a second paragraph.
</code></pre>
<ol>
<li>third thing</li>
</ol>
<pre><code>third thing details in a second paragraph.
</code></pre>
</dd>
</dl>

Tested with:

/usr/local/bin/markdown_py -x def_list definitions.md
/usr/local/bin/markdown_py --version
# => markdown_py 3.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug report.extensionRelated to one or more of the included extensions.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions