From cb4317192a9bae1dfc5937d2f0ffa03c7891d57e Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Mon, 7 Jul 2025 10:33:31 +0200 Subject: [PATCH] try replacing locate with query --- lib/todos.typ | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/todos.typ b/lib/todos.typ index 6e879b2..b8bf364 100644 --- a/lib/todos.typ +++ b/lib/todos.typ @@ -27,7 +27,13 @@ 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) + ")" + ) + list.item(link(l)[TODO n°#t.at(1) p.#locs.first().location().page() : #t.last()]) } } }