From 92aba81a91364eb49f3a613cd2db3b2163202434 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 5 Feb 2024 10:42:14 +0100 Subject: Support text show rules that match their own output (#3327) --- tests/typ/compiler/recursion.typ | 15 --------------- tests/typ/compiler/show-text.typ | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 15 deletions(-) (limited to 'tests/typ') diff --git a/tests/typ/compiler/recursion.typ b/tests/typ/compiler/recursion.typ index ef5ea7e6..f5f870b5 100644 --- a/tests/typ/compiler/recursion.typ +++ b/tests/typ/compiler/recursion.typ @@ -52,20 +52,5 @@ // Test recursive show rules. // Error: 22-25 maximum show rule depth exceeded // Hint: 22-25 check whether the show rule matches its own output -// Hint: 22-25 this is a current compiler limitation that will be resolved in the future #show math.equation: $x$ $ x $ - ---- -// Error: 18-21 maximum show rule depth exceeded -// Hint: 18-21 check whether the show rule matches its own output -// Hint: 18-21 this is a current compiler limitation that will be resolved in the future -#show "hey": box[hey] -hey - ---- -// Error: 14-19 maximum show rule depth exceeded -// Hint: 14-19 check whether the show rule matches its own output -// Hint: 14-19 this is a current compiler limitation that will be resolved in the future -#show "hey": "hey" -hey diff --git a/tests/typ/compiler/show-text.typ b/tests/typ/compiler/show-text.typ index c279507b..7837bb46 100644 --- a/tests/typ/compiler/show-text.typ +++ b/tests/typ/compiler/show-text.typ @@ -13,6 +13,27 @@ Die Zeitung Der Spiegel existiert. TeX, LaTeX, LuaTeX and LuaLaTeX! +--- +// Test direct cycle. +#show "Hello": text(red)[Hello] +Hello World! + +--- +// Test replacing text with raw text. +#show "rax": `rax` +The register rax. + +--- +// Test indirect cycle. +#show "Good": [Typst!] +#show "Typst": [Fun!] +#show "Fun": [Good!] + +#set text(ligatures: false) +Good \ +Fun \ +Typst \ + --- // Test that replacements happen exactly once. #show "A": [BB] -- cgit v1.2.3