Skip to content

Commit 092678f

Browse files
committed
fix extra separator at the end of each line in csv component
thanks @mtt-artis for reporting the issue #608 (comment)
1 parent f7387e7 commit 092678f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sqlpage/templates/csv.handlebars

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
{{~#if (eq @row_index 0)~}}{{! header }}
88
{{~#each this~}}
99
{{~url_encode (csv_escape @key ../../separator)~}}
10-
{{~default ../../separator ","~}}
10+
{{~#if (not @last)~}}
11+
{{default ../../separator ","}}
12+
{{~/if~}}
1113
{{~/each~}}
1214
%0A{{! %0A = newline}}
1315
{{~/if~}}
1416
{{~#each this~}}
1517
{{~url_encode (csv_escape this ../../separator)~}}
16-
{{~default ../../separator ","~}}
18+
{{~#if (not @last)~}}
19+
{{default ../../separator ","}}
20+
{{~/if~}}
1721
{{~/each~}}
1822
%0A
1923
{{~/each_row~}}

0 commit comments

Comments
 (0)