matrixfmt: fix trimming all-space entity string

This commit is contained in:
Tulir Asokan
2026-04-27 20:12:29 +03:00
parent 6eacf38d74
commit 9e1c42a992

View File

@@ -108,6 +108,10 @@ func (es *EntityString) TrimSpace() *EntityString {
}
break
}
if cutStart == len(es.String) {
DebugLog(" -> ALLSPACE\n")
return &EntityString{}
}
for cutEnd = len(es.String) - 1; cutEnd >= 0; cutEnd-- {
switch es.String[cutEnd] {
case '\t', '\n', '\v', '\f', '\r', ' ', 0x85, 0xA0: