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
This commit is contained in:
parent
68729fa5a3
commit
d6e55b5f36
1 changed files with 9 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue