Thinkmill / keystatic

First class CMS experience, TypeScript API, Markdown & YAML/JSON based, no DB
https://keystatic.com
MIT License
1.02k stars 68 forks source link

[mdx field] don't add empty lines between list items #1167

Closed stefanprobst closed 4 days ago

stefanprobst commented 1 month ago

repro: https://github.com/stefanprobst/issue-keystatic-md-list

keystatic will save unordered lists by always adding an empty line between list items. for example:

- one

- two

- three

when the mdx is rendered, this will actually wrap each list item in a paragraph:

<ul>
<li>
<p>one</p>
</li>
<li>
<p>two</p>
</li>
<li>
<p>three</p>
</li>
</ul>

which looks like this:

Screenshot_20240530_161930


when i manually edit the mdx file and remove the empty lines, this will render as:

<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>

Screenshot_20240530_162043


from the remark docs:

there are two kinds of lists in markdown, tight and loose. Lists are tight by default but if there is a blank line between two list items or between two blocks inside an item, that turns the whole list into a loose list. When turning markdown into HTML, paragraphs in tight lists are not wrapped in <p> tags.