summaryrefslogtreecommitdiff
path: root/tests/typ/text
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-02-08 16:39:37 +0100
committerLaurenz <laurmaedje@gmail.com>2022-02-09 12:34:19 +0100
commite089b6ea40015e012302dc55ac5d6cb42ca4876e (patch)
treedbb66237cb996bc880560dfd94ac9b682e1ac985 /tests/typ/text
parent68503b9a07b00bce3f4d377bcfe945452de815ea (diff)
Set rules for everything
Diffstat (limited to 'tests/typ/text')
-rw-r--r--tests/typ/text/links.typ18
-rw-r--r--tests/typ/text/par.typ12
2 files changed, 12 insertions, 18 deletions
diff --git a/tests/typ/text/links.typ b/tests/typ/text/links.typ
index f2da8b9c..99037ee3 100644
--- a/tests/typ/text/links.typ
+++ b/tests/typ/text/links.typ
@@ -1,3 +1,6 @@
+// Test hyperlinking.
+
+---
// Link without body.
#link("https://example.com/")
@@ -8,22 +11,25 @@
This link appears #link("https://google.com/")[in the middle of] a paragraph.
// Prefix is trimmed.
-Contact #link("mailto:hi@typst.app") or call #link("tel:123") for more information.
+Contact #link("mailto:hi@typst.app") or
+call #link("tel:123") for more information.
---
// Styled with underline and color.
-#let link(url, body) = link(url, text(fill: rgb("283663"), underline(body)))
-You could also make the #link("https://html5zombo.com/")[link look way more typical.]
+#set link(fill: rgb("283663"))
+You could also make the
+#link("https://html5zombo.com/")[link look way more typical.]
---
// Transformed link.
#set page(height: 60pt)
-#let link = link("https://typst.app/")[LINK]
-My cool #move(x: 0.7cm, y: 0.7cm, rotate(10deg, scale(200%, link)))
+#set link(underline: false)
+#let mylink = link("https://typst.app/")[LINK]
+My cool #move(x: 0.7cm, y: 0.7cm, rotate(10deg, scale(200%, mylink)))
---
// Link containing a block.
-#link("https://example.com/", block[
+#link("https://example.com/", underline: false, block[
My cool rhino
#move(x: 10pt, image("../../res/rhino.png", width: 1cm))
])
diff --git a/tests/typ/text/par.typ b/tests/typ/text/par.typ
index b0e60955..2bff4a47 100644
--- a/tests/typ/text/par.typ
+++ b/tests/typ/text/par.typ
@@ -30,18 +30,6 @@ You
A #set par(spacing: 0pt, leading: 0pt); B #parbreak() C
---
-// Test that paragraph breaks due to block nodes have the correct spacing.
-#set par(spacing: 10pt)
-- A
-
-#set par(leading: 0pt)
-- B
-- C
-#set par(leading: 5pt)
-- D
-- E
-
----
// Test weird metrics.
#set par(spacing: 100%, leading: 0pt)
But, soft! what light through yonder window breaks?