mirror of
https://github.com/typst/typst
synced 2025-05-15 17:45:27 +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()
|
elem.text().chars().next()
|
||||||
} else if child.is::<SmartQuoteElem>() {
|
} else if child.is::<SmartQuoteElem>() {
|
||||||
Some('"')
|
Some('"')
|
||||||
} else if child.is::<SpaceElem>() || child.is::<HElem>() {
|
} else if child.is::<SpaceElem>()
|
||||||
|
|| child.is::<HElem>()
|
||||||
|
|| child.is::<LinebreakElem>()
|
||||||
|
{
|
||||||
Some(SPACING_REPLACE)
|
Some(SPACING_REPLACE)
|
||||||
} else {
|
} else {
|
||||||
Some(OBJ_REPLACE)
|
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