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