fix: no newline at end of file
parent
afcee321fa
commit
176e35a16e
|
@ -4,10 +4,12 @@ import "strings"
|
|||
|
||||
func Generate(bases []Node) string {
|
||||
lines := make([]string, len(bases))
|
||||
|
||||
for i, base := range bases {
|
||||
lines[i] = base.String()
|
||||
}
|
||||
|
||||
return strings.Join(lines, string(NewlineToken)+string(NewlineToken))
|
||||
result := strings.Join(lines, string(NewlineToken)+string(NewlineToken))
|
||||
// Fix no newline at end of file
|
||||
result += string(NewlineToken)
|
||||
return result
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ func TestGenerate(t *testing.T) {
|
|||
text: "item 2",
|
||||
},
|
||||
},
|
||||
want: "# header\n\n- item 1\n\n- item 2",
|
||||
want: "# header\n\n- item 1\n\n- item 2\n",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue