Template : How to prevent linebreak?

Hello,
I’ve this template “code” that just print defined text. If the user want to add an author, the author is shown surrounded with parenthesis.
However, since the text added has a line break at the end, the text and the author does not show on the same line. How to prevent this ?
Thanks in advance for answers

#let header_tune(body, author: "") = [
  #set text(size: 7pt, font : "Molengo")
  "Air : "
  #body  
  #if (author != "") { "("+ author +")"} else {""}
]

#show: style.header_tune.with(author : "Author")
Musique très connue

here’s the result :

Capture d'écran 2024-12-29 143449

I want it rendered as :
“Air : Musique très connue (Author)”

I know that i can use something like :

#style.header_tune("Musique très connue", author : "Alex")

But i think that it force the end user to either declare a valiable of type text() or set the parameter directly making it “less intuitive” and “less customisable”.

I suspect that you simply have an additional newline after “Musique très connue”. If I just copy your code and the file ends after that line, everything is on the same line.

Regarding your readability concerns: I think it depends on what the document would contain overall, depending on that a normal function call could look very reasonable. Keep in mind that the function call could look like this, which is fairly customizable (you can style the body, it doesn’t need to be a plain string):

#style.header_tune(author: "Author")[
  Musique très connue
]