mirror of
https://github.com/kovetskiy/mark.git
synced 2026-03-19 17:17:38 +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
|
// it's found, check if title is given and return it
|
||||||
start := index + 6
|
start := index + 6
|
||||||
if len(lang) > start {
|
if len(lang) > start {
|
||||||
return lang[start:]
|
return strings.TrimSpace(lang[start:])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user