diff --git a/lib/todos.typ b/lib/todos.typ index 6e879b2..6be7b6f 100644 --- a/lib/todos.typ +++ b/lib/todos.typ @@ -27,7 +27,19 @@ text(size: 2em, weight: "bold", fill:red)[TO-DOs] for t in todo-list.final() { let l = label(t.first()) - list.item(link(l)[TODO n°#t.at(1) p.#locate(l).page() : #t.last()]) + let locs = query(l) + + assert( + locs.len() >= 1, + message: "todo '" + t.first() + "' not found: " + + repr(t.last()) + " (query(" + repr(l) + ") = " + repr(locs) + ")" + ) + + if locs.len() >= 1 { + list.item(link(l)[TODO n°#t.at(1) p.#locs.first().location().page() : #t.last()]) + } else { + list.item(link(l)[TODO n°#t.at(1) p.??? : #t.last()]) + } } } }