1
1
Fork 0
mirror of https://github.com/mjl-/mox.git synced 2025-04-21 21:40:01 +03:00

don't use strings.Lines, it's only available in go1.24 and we support go1.23 too
Some checks are pending
Build and test / build-test (oldstable) (push) Waiting to run
Build and test / build-test (stable) (push) Waiting to run

This commit is contained in:
Mechiel Lukkien 2025-03-28 18:20:18 +01:00
parent 68729fa5a3
commit d6e55b5f36
No known key found for this signature in database

View file

@ -310,9 +310,16 @@ func previewHTML(r io.Reader) (string, error) {
if quoteLevel > 0 {
q := strings.Repeat("> ", quoteLevel)
var sb strings.Builder
for line := range strings.Lines(s) {
for s != "" {
o := strings.IndexByte(s, '\n')
if o < 0 {
o = len(s)
} else {
o++
}
sb.WriteString(q)
sb.WriteString(line)
sb.WriteString(s[:o])
s = s[o:]
}
s = sb.String()
}