Escape CSV cells that start with tab or carriage return
Trim-based formula detection skipped the old rule for leading control characters; check those bytes before trim. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
@@ -38,6 +38,8 @@ func TestSanitizeCell(t *testing.T) {
|
||||
assert.Equal(t, "'@sum", SanitizeCell("@sum"))
|
||||
assert.Equal(t, "' =1+1", SanitizeCell(" =1+1"))
|
||||
assert.Equal(t, "'\n=1+1", SanitizeCell("\n=1+1"))
|
||||
assert.Equal(t, "'\tplain", SanitizeCell("\tplain"))
|
||||
assert.Equal(t, "'\rhello", SanitizeCell("\rhello"))
|
||||
assert.Equal(t, "'\\evil", SanitizeCell("\\evil"))
|
||||
assert.Equal(t, "'-5", SanitizeCell("-5"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user