parsedown icon indicating copy to clipboard operation
parsedown copied to clipboard

bullet points rendered differently depending on if there's multiple bullet lists

Open skeets23 opened this issue 4 years ago • 1 comments

- a
- b
    - c

renders as:

<ul>
<li>a</li>
<li>b
<ul>
<li>c</li>
</ul></li>
</ul>

... which is great. However:

- a
- b
    - c

- 1
- 2

renders as:

<ul>
<li>
<p>a</p>
</li>
<li>
<p>b</p>
<ul>
<li>c</li>
</ul>
</li>
<li>
<p>1</p>
</li>
<li>
<p>2</p>
</li>
</ul>
  • Suddenly, all list items are being wrapped in <p> tags. So depending on style sheets, the bullet list can look completely different after you add a second <ul>, because for some reason, that adds <p> tags to all <li> tags.
  • These <p> tags, while causing unexpected behavior, could be acceptable if they were applied to all li elements, because at least they would all look the same.... but indented <li> elements do not change.... so by result, you end up with top level li elements with p tags inside them, and second level li elements without the p tag, giving a very inconsistent feel (notice the "c" is not wrapped in a p tag, while all the rest of the text was).

skeets23 avatar Apr 10 '20 05:04 skeets23

I have just notices this recently, but if you go to the demo site: https://parsedown.org/demo

at create and render a list like so:

- something
- something

- something else

That you will get:

<ul>
    <li>something</li>
    <li><p>something</p></li>
    <li>something else</li>
</ul>

mabasic avatar Jun 08 '20 05:06 mabasic