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?
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>
This is a nasty problem which I also cannot seem to solve in an elegant way. However, for compilation to HTML there is a simple workaround: place a </ul>
or </ol>
tag after the last item of your nested list.
1. first item
2. second item
- first subitem
- second subitem</ul>
more info about the 2nd item
3. third item
This will trigger the HTML to end the - in this case unordered - nested list before Markdown instructs it to. Luckily, this doesn't break your layout at all, as long as you are mixing unordered (<ul>
) and ordered (<ol>
) lists. If your nested list is of the same type as its parent this will break your layout*.
If so desired, you can also place a <br>
element before the first line that does not belong to the nested list anymore, which I find to produce a more visually appealing layout.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With