I had some html like this:
<ul>
<li> 1 </li>
<li> 2 </li>
</ul>
<ul>
<li> a </li>
<li> b </li>
</ul>
This HTML was generated using CKEditor, but I got fed up with WYSIWYGs and decided to use markdown instead.
I then converted it to markdown.
My markdown looks like:
- 1
- 2
- a
- b
However my output from my markdown is this:
<ul>
<li> 1 </li>
<li> 2 </li>
<li> a </li>
<li> b </li>
</ul>
I need two separate lists as per the html prior to conversion. Can this be done?
First I'll clarify the undesired behaviour, then I'll show you how to get the desired behaviour.
Markdown implementations often concatenate lists separated by whitespace.
For example, the following markdown has 5 lists
- a
- a
- b
- a
- b
- a
- b
- c
- a
- b
- c
and it renders as one big list:
a
a
b
a
a
c
a
To get separate lists to render separately, separate your markdown lists with something that maps from markdown to invisible HTML. Each of these work fine:
<!-- -->
<br>
Below are 4 markdown lists using each of them
- a
<!-- -->
- a
- b
<br>
- a
- b
- a
- b
- c
which render as 4 separate lists:
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