From 529d3e10c6b4d973e88b6c295eb22a45ea426e42 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 11 Mar 2023 17:42:40 +0100 Subject: Section references --- tests/typ/compiler/set.typ | 4 ++-- tests/typ/meta/ref.typ | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 tests/typ/meta/ref.typ (limited to 'tests/typ') diff --git a/tests/typ/compiler/set.typ b/tests/typ/compiler/set.typ index 36a42745..a4482e6d 100644 --- a/tests/typ/compiler/set.typ +++ b/tests/typ/compiler/set.typ @@ -51,8 +51,8 @@ Hello *#x* --- // Test conditional set. #show ref: it => { - set text(red) if it.target == "unknown" - it + set text(red) if it.label == + "@" + str(it.label) } @hello from the @unknown diff --git a/tests/typ/meta/ref.typ b/tests/typ/meta/ref.typ new file mode 100644 index 00000000..85750712 --- /dev/null +++ b/tests/typ/meta/ref.typ @@ -0,0 +1,21 @@ +// Test references. + +--- +#set heading(numbering: "1.") + += Introduction +See @setup. + +== Setup +As seen in @intro, we proceed. + +--- +// Error: 1-5 label does not exist in the document +@foo + +--- += First += Second + +// Error: 1-5 label occurs multiple times in the document +@foo -- cgit v1.2.3