Fix incorrect rendering csv file when file size is larger than UI.CSV.MaxFileSize (#29653) (#29663)

Backport #29653 by @yp05327

Fix #29506

Co-authored-by: yp05327 <576951401@qq.com>
(cherry picked from commit 6651d2d87aa4af96bf2c992e3ecae6a290d07496)
This commit is contained in:
Giteabot 2024-03-08 17:13:58 +08:00 committed by Earl Warren
parent bd0978ce72
commit e151e04673
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -93,8 +93,10 @@ func (Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io.Wri
if _, err := tmpBlock.WriteString(html.EscapeString(string(rawBytes))); err != nil {
return err
}
_, err = tmpBlock.WriteString("</pre>")
return err
if _, err := tmpBlock.WriteString("</pre>"); err != nil {
return err
}
return tmpBlock.Flush()
}
rd, err := csv.CreateReaderAndDetermineDelimiter(ctx, bytes.NewReader(rawBytes))