diff --git a/modules/markup/csv/csv.go b/modules/markup/csv/csv.go index 0ec75be43767f..8c80683a3b028 100644 --- a/modules/markup/csv/csv.go +++ b/modules/markup/csv/csv.go @@ -97,7 +97,7 @@ func (r Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io.W return err } - row := 1 + row := 0 for { fields, err := rd.Read() if err == io.EOF || (row >= maxRows && maxRows != 0) { diff --git a/modules/markup/csv/csv_test.go b/modules/markup/csv/csv_test.go index 8c07184b21eeb..a194f11247d52 100644 --- a/modules/markup/csv/csv_test.go +++ b/modules/markup/csv/csv_test.go @@ -16,10 +16,10 @@ import ( func TestRenderCSV(t *testing.T) { var render Renderer kases := map[string]string{ - "a": "
1a
", - "1,2": "
112
", - "1;2\n3;4": "
112
234
", - "
": "
1<br/>
", + "a": "
0a
", + "1,2": "
012
", + "1;2\n3;4": "
012
234
", + "
": "
0<br/>
", } for k, v := range kases {