summaryrefslogtreecommitdiff
path: root/tests/typ/text/whitespace.typ
blob: 8dcc59e366e6f53ad46506d315de97e9b5f29278 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Test whitespace handling.

---
// Spacing around code constructs.
A#let x = 1;B  #test(x, 1) \
C #let x = 2;D #test(x, 2) \
E#if true [F]G \
H #if true{"I"} J \
K #if true [L] else []M \
#let c = true; N#while c [{c = false}O] P \
#let c = true; Q #while c { c = false; "R" } S \
T#for _ in (none,) {"U"}V

---
// Test spacing with comments.
A/**/B/**/C \
A /**/ B/**/C \
A /**/B/**/ C

---
// Test that a run consisting only of whitespace isn't trimmed.
A[#set text("IBM Plex Serif"); ]B

---
// Test font change after space.
Left [#set text("IBM Plex Serif");Right].

---
// Test that linebreak consumed surrounding spaces.
#align(center)[A \ B \ C]

---
// Test that space at start of non-backslash-linebreak line isn't trimmed.
A{"\n"} B

---
// Test that trailing space does not force a line break.
LLLLLLLLLLLLLLLLLL R _L_