Skip to content

Commit

Permalink
fix: Parser string sanitizer
Browse files Browse the repository at this point in the history
Parser methods use the parse.cleanString method internally
to clean up strings from markup. Before this commit, this method
did not clean up whitespace that was protected by the additional
trim-set passed to the function. This commit fixes this buggy behavior,
albeit not in an optimised fashion.
  • Loading branch information
ditsuke committed Jun 18, 2022
1 parent fe04635 commit 18a4231
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion amizone/internal/parse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ const (
// cleanString trims off whitespace and additional runes passed.
func cleanString(s string, set ...rune) string {
ws := strings.TrimSpace(s)
return strings.Trim(ws, string(set))
wd := strings.Trim(ws, string(set))
return strings.TrimSpace(wd)
}

0 comments on commit 18a4231

Please sign in to comment.