From f0cb29cf6668ab96992b1e48278d9f5b1f9e4976 Mon Sep 17 00:00:00 2001 From: xuri Date: Sat, 5 Mar 2022 14:48:34 +0800 Subject: This closes #1162, improve the compatibility with alternate content Preserve alternate content in the workbook, worksheet, and drawingML --- comment_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'comment_test.go') diff --git a/comment_test.go b/comment_test.go index 952763d..01f1e42 100644 --- a/comment_test.go +++ b/comment_test.go @@ -12,6 +12,7 @@ package excelize import ( + "encoding/xml" "path/filepath" "strings" "testing" @@ -38,7 +39,7 @@ func TestAddComments(t *testing.T) { } f.Comments["xl/comments2.xml"] = nil - f.Pkg.Store("xl/comments2.xml", []byte(`Excelize: Excelize: `)) + f.Pkg.Store("xl/comments2.xml", []byte(xml.Header+`Excelize: Excelize: `)) comments := f.GetComments() assert.EqualValues(t, 2, len(comments["Sheet1"])) assert.EqualValues(t, 1, len(comments["Sheet2"])) -- cgit v1.2.1