From acd42c4f622e9f48e573c598222dfebc6da63f61 Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Mon, 7 Jul 2025 12:37:53 +0200 Subject: [PATCH] anticipate a potential fallback for todos --- lib/todos.typ | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/todos.typ b/lib/todos.typ index b8bf364..6be7b6f 100644 --- a/lib/todos.typ +++ b/lib/todos.typ @@ -28,12 +28,18 @@ for t in todo-list.final() { let l = label(t.first()) 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()]) + ) + + 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()]) + } } } }