Skip to content

Commit cf6398c

Browse files
committed
Fixed annotation handling introduced in previous commit
Fixes #85 (both parts)
1 parent 3de208e commit cf6398c

6 files changed

Lines changed: 52 additions & 3 deletions

File tree

src/lib.typ

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,6 @@
813813
}
814814
}
815815

816-
let block-label = auto
817816
let display-names = (
818817
__codly-args.display-name.type_check
819818
)(if "display-name" in extra {
@@ -1558,7 +1557,7 @@
15581557
supplement: none,
15591558
numbering: (..) => {
15601559
ref(block-label)
1561-
sep
1560+
reference-sep
15621561
referenced
15631562
},
15641563
[]

tests/issues/81-highlight-inset-with-tags.typ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#import "@preview/codly:1.3.0": *
1+
#import "../../codly.typ": *
22
#show: codly-init
33

44
#codly(
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#import "../../codly.typ": *
2+
3+
4+
#show: codly-init
5+
6+
@test1
7+
8+
#figure(caption: "Test")[
9+
#codly(
10+
reference-by: "item",
11+
annotations: (
12+
(start: 2, label: <test1>),
13+
)
14+
)
15+
```py
16+
print("Hello, world!")
17+
18+
for i in range(1, 5):
19+
print(i)
20+
21+
if i == 3:
22+
print("Three!")
23+
```
24+
] <figure>
25+
26+
@test2
27+
@test3
28+
29+
#figure(caption: "Test")[
30+
#codly(
31+
reference-by: "item",
32+
annotations: (
33+
(start: 2, label: <test2>),
34+
(start: 4, label: <test3>),
35+
)
36+
)
37+
```py
38+
print("Hello, world!")
39+
40+
for i in range(1, 5):
41+
print(i)
42+
43+
if i == 3:
44+
print("Three!")
45+
```
46+
] <figure2>

tests/issues/ref/12.png

-243 Bytes
Loading

tests/issues/ref/13.png

44 KB
Loading

tests/issues/test.typ

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,8 @@ contained within a figure and that figure must have a label.")*/
5050
#codly-reset()
5151

5252
#include "81-highlight-inset-with-tags.typ"
53+
#pagebreak()
54+
#codly-reset()
55+
56+
#include "85-annotation-labels.typ"
5357
#codly-reset()

0 commit comments

Comments
 (0)