Ver código fonte

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>
tags/v1.21.8
Giteabot 2 meses atrás
pai
commit
6651d2d87a
Nenhuma conta vinculada ao e-mail do autor do commit
1 arquivos alterados com 4 adições e 2 exclusões
  1. 4
    2
      modules/markup/csv/csv.go

+ 4
- 2
modules/markup/csv/csv.go Ver arquivo

@@ -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))

Carregando…
Cancelar
Salvar