fix: trim whitespace from ParseTitle result

ParseTitle returned lang[start:] without trimming, so inputs like
'python title  My Title' returned '  My Title' with leading spaces.
The extra whitespace propagated into the rendered Confluence title
element. Add strings.TrimSpace to remove leading/trailing whitespace.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Manuel Rüger 2026-03-13 02:01:45 +01:00
parent d714bc9d2b
commit 0d735203dd

View File

@ -72,7 +72,7 @@ func ParseTitle(lang string) string {
// it's found, check if title is given and return it
start := index + 6
if len(lang) > start {
return lang[start:]
return strings.TrimSpace(lang[start:])
}
}
return ""