mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
This creates a smaller state machine helper type for softness coalescing, which does not own the resulting nodes. While this creates a bit more duplication in stack and par builder, it makes it a lot easier to integrate additional logic into the paragraph builder. Furthermore: - Line breaks are now "hard", that is, not coalesced with each other. - Text nodes with equal style are now merged allowing for example `f{}i` to form a ligature.
26 lines
323 B
Typst
26 lines
323 B
Typst
// Test forced line breaks.
|
|
|
|
---
|
|
// Directly after word.
|
|
Line\ Break
|
|
|
|
// Spaces around.
|
|
Line \ Break
|
|
|
|
// Directly before word does not work.
|
|
No \Break
|
|
|
|
\ Before
|
|
|
|
Multiple \ \ \
|
|
|
|
Times
|
|
|
|
---
|
|
#let linebreak() = [
|
|
// Inside the old line break definition is still active.
|
|
#circle(radius: 2pt, fill: #000) \
|
|
]
|
|
|
|
A \ B \ C
|