mirror of
https://github.com/kristoferssolo/LU-DF-Typst-Template.git
synced 2026-03-21 16:16:27 +00:00
fix: remove linebreak and duplicate space from title content
This commit is contained in:
28
src/lib.typ
28
src/lib.typ
@@ -293,18 +293,26 @@
|
||||
|
||||
make-attachments(attachment-title, attachments)
|
||||
|
||||
let title-text = if type(title) == content {
|
||||
title
|
||||
.fields()
|
||||
.children
|
||||
.filter(it => it.func() != linebreak)
|
||||
.fold((), (acc, it) => {
|
||||
if it == [ ] and acc.last() == [ ] {
|
||||
acc
|
||||
} else {
|
||||
acc + (it,)
|
||||
}
|
||||
})
|
||||
.join("")
|
||||
} else {
|
||||
title
|
||||
}
|
||||
|
||||
if display-documentary {
|
||||
make-documentary-page(
|
||||
if type(title) == content {
|
||||
title
|
||||
.fields()
|
||||
.values()
|
||||
.at(0)
|
||||
.filter(it => it.func() != linebreak and it != [ ])
|
||||
.join(" ")
|
||||
} else {
|
||||
title
|
||||
},
|
||||
title-text,
|
||||
authors,
|
||||
advisors,
|
||||
reviewer,
|
||||
|
||||
Reference in New Issue
Block a user