Text after the end of a nested list doesn't align properly

markdown, r-markdown

Solution

The following places "more info" as an independant paragraph inside the second subitem bullet point, in `pandoc` markdown.

1. first item
2. second item
    - first subitem
    - second subitem

        more info about the 2nd item

3. third item

Output:

<ol style="list-style-type: decimal">
<li>first item</li>
<li>second item
<ul>
<li>first subitem</li>
<li><p>second subitem</p>
<p>more info about the 2nd item</p></li>
</ul></li>
<li>third item</li>
</ol>

Problem

For example, this ``` 1. first item 2. second item - first subitem - second subitem more info about the 2nd item 3. third item ``` produces this How do I get "more info about the 2nd item" to appear where it does in the code?

Original source