lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
205 stars 97 forks source link

`--list-color` gets used on single-item lists, but not multi-item lists in a post #70

Closed samgiz closed 1 year ago

samgiz commented 1 year ago

With the following post:

---
title: title
---

## preface

list 1

* this one uses list color

list 2

* This doesn't use list color

* And neither does this.

I get the following result:

image

Looking at the produced source code we can see that the multiline list elements get wrapped in a <p> tag, but not the singleton list element:

<h2 id="preface">preface</h2>
<p>list 1</p>
<ul>
<li>this one uses list color</li>
</ul>
<p>list 2</p>
<ul>
<li>
<p>This doesn&rsquo;t use list color</p>
</li>
<li>
<p>And neither does this.</p>
</li>
</ul>

I'm not sure what's the expected behaviour here, but would be good to have them behave the same way. Personally I don't see a reason to use list-color here, it's simply harder to read.

samgiz commented 1 year ago

After further investigation the newline between the items in the second list are important:

---
title: title
---

## preface

list 1

* this one uses list color

list 2

* So does this
* And this.

image

Adding the <p> tag only when there's a newline between list items seems to be the expected behaviour. I still think that the two lists in my original post should be coloured the same way.

lukeorth commented 1 year ago

Thanks for reporting this -- I agree with you. I wasn't aware that markdown added a <p> tag between list items... strange. Standby for a fix.