mirror of
https://github.com/kovetskiy/mark.git
synced 2026-03-17 07:57:37 +08:00
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:
parent
d714bc9d2b
commit
0d735203dd
@ -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 ""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user