lukeed/tidyPublic

fix: keep lines from opening blocks

A paragraph line indented four or more spaces can start with `>`,
`#`, a list marker, a fence, a thematic break, or an HTML tag and still
be text. Writing it without its indent opened that block instead.

Such a line now joins the line before with a space, as Prettier does
for quotes, headings, and list markers. A line of only `=` or `-` gets
a backslash instead, also as in Prettier, so it can't underline a
setext heading. Prettier keeps the line break before fences, breaks,
and HTML, which changes the document, so mdtidy joins those too.
LELuke Edwards authored
557661fPatch
Parent2e1cf51
4 files changed+188-1
StackedSplit
crates/tidy/src/markdown/mod.rs+1 −0
crates/tidy/src/markdown/opener.rs+153 −0
crates/tidy/src/markdown/writer.rs+12 −1
crates/tidy/tests/markdown.rs+22 −0