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 --- drawing_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drawing_test.go') diff --git a/drawing_test.go b/drawing_test.go index d33977f..e37b771 100644 --- a/drawing_test.go +++ b/drawing_test.go @@ -12,6 +12,7 @@ package excelize import ( + "encoding/xml" "sync" "testing" ) @@ -22,9 +23,13 @@ func TestDrawingParser(t *testing.T) { Pkg: sync.Map{}, } f.Pkg.Store("charset", MacintoshCyrillicCharset) - f.Pkg.Store("wsDr", []byte(``)) + f.Pkg.Store("wsDr", []byte(xml.Header+``)) // Test with one cell anchor f.drawingParser("wsDr") // Test with unsupported charset f.drawingParser("charset") + // Test with alternate content + f.Drawings = sync.Map{} + f.Pkg.Store("wsDr", []byte(xml.Header+``)) + f.drawingParser("wsDr") } -- cgit v1.2.1