mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
layout::par::collect: Treat linebreak element as whitespace (#1542)
Fixes #1540.
This commit is contained in:
parent
e1d76960eb
commit
622cef8e00
@ -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)
|
||||
|
BIN
tests/ref/bugs/smartquotes-on-newline.png
Normal file
BIN
tests/ref/bugs/smartquotes-on-newline.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
7
tests/typ/bugs/smartquotes-on-newline.typ
Normal file
7
tests/typ/bugs/smartquotes-on-newline.typ
Normal file
@ -0,0 +1,7 @@
|
||||
// Test that smart quotes are inferred correctly across newlines.
|
||||
|
||||
---
|
||||
"test"#linebreak()"test"
|
||||
|
||||
"test"\
|
||||
"test"
|
Loading…
x
Reference in New Issue
Block a user