From 78d374aaad793b00cedd5713e42d969a061976f2 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 5 Mar 2026 16:08:00 +0200 Subject: [PATCH] fix: remove linebreak and duplicate space from title content --- src/lib.typ | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/lib.typ b/src/lib.typ index c812d05..4bb10f5 100644 --- a/src/lib.typ +++ b/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,