layout::par::collect: Treat linebreak element as whitespace (#1542)

Fixes #1540.
This commit is contained in:
bluebear94 2023-06-24 08:26:06 -04:00 committed by GitHub
parent e1d76960eb
commit 622cef8e00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -609,7 +609,10 @@ fn collect<'a>(
elem.text().chars().next()
} else if child.is::<SmartQuoteElem>() {
Some('"')
} else if child.is::<SpaceElem>() || child.is::<HElem>() {
} else if child.is::<SpaceElem>()
|| child.is::<HElem>()
|| child.is::<LinebreakElem>()
{
Some(SPACING_REPLACE)
} else {
Some(OBJ_REPLACE)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,7 @@
// Test that smart quotes are inferred correctly across newlines.
---
"test"#linebreak()"test"
"test"\
"test"