summaryrefslogtreecommitdiff
path: root/tests/suite
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-09-02 20:43:59 +0200
committerGitHub <noreply@github.com>2024-09-02 18:43:59 +0000
commitcfde809feb33bc057e860c5128c74fb9df6f030c (patch)
tree5b367da382b9dab2840ce99ec05bad03f3039168 /tests/suite
parent9fd796e0e24ef9a76f8f7328e0a1eed350e91320 (diff)
New realization / Text show rules now work across elements (#4876)
Diffstat (limited to 'tests/suite')
-rw-r--r--tests/suite/foundations/label.typ9
-rw-r--r--tests/suite/layout/flow/invisibles.typ2
-rw-r--r--tests/suite/layout/grid/grid.typ4
-rw-r--r--tests/suite/layout/place.typ2
-rw-r--r--tests/suite/styling/show-text.typ63
5 files changed, 67 insertions, 13 deletions
diff --git a/tests/suite/foundations/label.typ b/tests/suite/foundations/label.typ
index 4875f697..af6d2380 100644
--- a/tests/suite/foundations/label.typ
+++ b/tests/suite/foundations/label.typ
@@ -19,15 +19,6 @@ The end.
#let b = [*B*]
#a <v> #b
---- label-on-text ---
-// Test labelled text.
-#show "t": it => {
- set text(blue) if it.has("label") and it.label == <last>
- it
-}
-
-This is a thing #[that <last>] happened.
-
--- label-dynamic-show-set ---
// Test abusing dynamic labels for styling.
#show <red>: set text(red)
diff --git a/tests/suite/layout/flow/invisibles.typ b/tests/suite/layout/flow/invisibles.typ
index 28118cb9..e9c2436f 100644
--- a/tests/suite/layout/flow/invisibles.typ
+++ b/tests/suite/layout/flow/invisibles.typ
@@ -56,6 +56,6 @@ Mix-and-match all the previous tests.
#counter("dummy").step()
#place(dx: -0.5cm, dy: -0.75cm, box(width: 200%)[OOF])
#line(length: 100%)
- #place(dy: -0.8em)[OOF]
+ #place(dy: 0.2em)[OOF]
#rect(height: 2cm, fill: gray)
]
diff --git a/tests/suite/layout/grid/grid.typ b/tests/suite/layout/grid/grid.typ
index 2d45095d..d35adca5 100644
--- a/tests/suite/layout/grid/grid.typ
+++ b/tests/suite/layout/grid/grid.typ
@@ -184,8 +184,8 @@
Top
#align(bottom)[
Bottom \
- Bottom \
- #v(0pt)
+ Bottom
+
Top
]
],
diff --git a/tests/suite/layout/place.typ b/tests/suite/layout/place.typ
index 0922800d..c29d2ddd 100644
--- a/tests/suite/layout/place.typ
+++ b/tests/suite/layout/place.typ
@@ -54,9 +54,9 @@ Second
--- place-float ---
#set page(height: 140pt)
#set place(clearance: 5pt)
-#lorem(6)
#place(auto, float: true, rect[A])
#place(auto, float: true, rect[B])
+#lorem(6)
#place(auto, float: true, rect[C])
#place(auto, float: true, rect[D])
diff --git a/tests/suite/styling/show-text.typ b/tests/suite/styling/show-text.typ
index 56b659b2..d073f72e 100644
--- a/tests/suite/styling/show-text.typ
+++ b/tests/suite/styling/show-text.typ
@@ -131,3 +131,66 @@ Heya
#show "Heya": set text(red)
#show "yaho": set text(weight: "bold")
Heyaho
+
+--- show-text-smartquote ---
+#show "up,\" she": set text(red)
+"What's up," she asked.
+
+--- show-text-apostrophe ---
+#show regex("Who's|We've"): highlight
+Who's got it? \
+We've got it.
+
+--- show-text-citation ---
+#show "hey": [@arrgh]
+@netwok hey
+
+#show bibliography: none
+#bibliography("/assets/bib/works.bib")
+
+--- show-text-list ---
+#show "hi": [- B]
+- A
+hi
+- C
+
+--- show-text-citation-smartquote ---
+#show "hey \"": [@arrgh]
+#show "dis": [@distress]
+@netwok hey " dis
+
+#show bibliography: none
+#bibliography("/assets/bib/works.bib")
+
+--- show-text-linebreak ---
+#show "lo\nwo": set text(red)
+Hello #[ ] \
+#[ ] #[ ] world!
+
+--- show-text-after-normal-show ---
+#show rect: "world"
+#show "lo wo": set text(red)
+hello #rect()
+
+--- show-text-space-collapsing ---
+#show "i ther": set text(red)
+hi#[ ]#[ ]the#"re"
+
+--- show-text-style-boundary ---
+#show "What's up": set text(blue)
+#show "your party": underline
+What's #[ ] up at #"your" #text(red)[party?]
+
+--- show-text-within-par ---
+#show "Pythagoras'": highlight
+$a^2 + b^2 = c^2$ is Pythagoras' theorem.
+
+--- show-text-outer-space ---
+// Spaces must be interior to strong textual elements for matching to work.
+// For outer spaces, it is hard to say whether they would collapse.
+#show "a\n": set text(blue)
+#show "b\n ": set text(blue)
+#show " c ": set text(blue)
+a \ #h(0pt, weak: true)
+b \ #h(0pt, weak: true)
+$x$ c $y$