mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-27 20:36:29 -04:00
Fix clampTrailingWhitespace breaking entries that contain both notes and other fields
This commit is contained in:
+3
-3
@@ -161,13 +161,13 @@ func clampTrailingWhitespace(decSlice []string) []string {
|
|||||||
switch endSpacesCount {
|
switch endSpacesCount {
|
||||||
case 0:
|
case 0:
|
||||||
// no trailing spaces
|
// no trailing spaces
|
||||||
decSlice[i] = noteLine
|
decSlice[i+4] = noteLine
|
||||||
case 1:
|
case 1:
|
||||||
// remove the single trailing space
|
// remove the single trailing space
|
||||||
decSlice[i] = strings.TrimRight(noteLine, " ")
|
decSlice[i+4] = strings.TrimRight(noteLine, " ")
|
||||||
default:
|
default:
|
||||||
// truncate the trailing spaces to two
|
// truncate the trailing spaces to two
|
||||||
decSlice[i] = noteLine[:len(noteLine)-endSpacesCount+2]
|
decSlice[i+4] = noteLine[:len(noteLine)-endSpacesCount+2]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user