try adding this header to your markdown file:
<style> p:has(+ ul) { margin-bottom: 0; } p + ul { margin-top: 0; } </style>