typst glossary bug

This commit is contained in:
anarsec 2024-04-15 18:30:02 +00:00
parent 679f46f7c6
commit 7decaf8359
No known key found for this signature in database
3 changed files with 20 additions and 15 deletions

View file

@ -85,6 +85,7 @@
outline(indent: 20pt, depth: 2)
// format links
let glossaryFootnote = state("x", [#footnote[anarsec.guide/glossary]<glossary-footnote>])
show link: it => {
it.body
if type(it.dest) == "string" {
@ -102,12 +103,13 @@
}
else if it.dest.starts-with("/glossary#") or it.dest.starts-with("/glossary/#") {
context {
let elements = query(heading.where(label: label(it.dest.trim("/glossary#", at: start).trim("/glossary/#", at: start)), level: 2))
let elements = query(heading.where(label: label(it.dest.trim("/glossary#", at: start).trim("/glossary/#", at: start))))
if elements.len() != 0 {
text[#super[]]
}
else {
footnote[anarsec.guide/glossary]
context glossaryFootnote.get()
glossaryFootnote.update(x => footnote(<glossary-footnote>))
}
}
}