Hugo’s markdown parser is powered by Goldmark (previous it was Blackfriday)
but it does not generate a p tag inside an li unless you have a double line break on your .md file.
See example markdown, not that there is only 1 line break on the - items:
This is a paragraph, followed by a list.
- Item 1
- Item 2
And here is another paragraph.
This is the generated HTML:
<p>This is a paragraph, followed by a list.</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<p>And here is another paragraph.</p>
But if you have 2 or more line breaks between the list items, you will get a p tag inside the list:
This is a paragraph, followed by a list.
- Item 1
- Item 2
And here is another paragraph.
This markdown above will generate this HTML:
<p>This is a paragraph, followed by a list.</p>
<ul>
<li>
<p>Item 1</p>
</li>
<li>
<p>Item 2</p>
</li>
</ul>
<p>And here is another paragraph.</p>