lukeed/tidyPublic

fix: spread loose items

Prettier treats a list item as loose when a blank line separates two
of its direct children, or the item from the next one, and then puts a
blank line between all of its blocks. The one exception is a nested
list, which keeps the source's spacing. mdtidy followed the source
for each pair of blocks instead.

The item now reads ahead to its end to decide. Blank lines inside a
nested list or a code block don't count, as in Prettier.
LELuke Edwards authored
fc0fe5bPatch
Parent7ff1132
3 files changed+96-11
StackedSplit
crates/tidy/src/markdown/writer/list.rs+52 −1
crates/tidy/src/markdown/writer/mod.rs+23 −10
crates/tidy/tests/markdown.rs+21 −0