lukeed/tidyPublic

fix: join wide lines like Prettier

When lines join in a paragraph, Prettier writes nothing for the line
break between two Chinese or Japanese characters, or next to their
punctuation, where mdtidy wrote a space. CSS renders such a break as
nothing between two wide characters (not Korean), so mdtidy now glues
them, and the semantics oracle compares such a break as nothing.

Prettier sometimes glues a break between Chinese or Japanese and Latin
text too, which CSS renders as a space; there mdtidy keeps a space
that doesn't break. In a reference link written as its label, the
break stays a line break, since gluing would change the label.
LELuke Edwards authored
a357585Patch
Parent4aa1095
7 files changed+140-7
StackedSplit
crates/tidy/markdown.Cargo.toml+1 −0
crates/tidy/src/markdown/wrap.rs+56 −2
crates/tidy/src/markdown/writer/inline.rs+11 −1
crates/tidy/src/markdown/writer/mod.rs+9 −2
crates/tidy/tests/fixtures/markdown/cjk.md+23 −0
crates/tidy/tests/markdown.rs+12 −0
crates/tidy/tests/support/events.rs+28 −2