From f41a2d15697f65f6835fca03df2f80aebf31d3fc Mon Sep 17 00:00:00 2001 From: Chris Grindstaff Date: Thu, 28 Mar 2013 17:05:49 -0300 Subject: [PATCH] CDATA is overwritten, append instead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See testcase in https://github.com/jteeuwen/go-pkg-rss/blob/master/feed_test.go of an example of where CDATA is overwritten. --- document.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/document.go b/document.go index ce62d61..4e2fbd8 100644 --- a/document.go +++ b/document.go @@ -117,7 +117,7 @@ func (this *Document) LoadStream(r io.Reader, charset CharsetFunc) (err error) { case xml.SyntaxError: return errors.New(tt.Error()) case xml.CharData: - ct.Value = strings.TrimSpace(string([]byte(tt))) + ct.Value = ct.Value + strings.TrimSpace(string([]byte(tt))) case xml.Comment: t := NewNode(NT_COMMENT) t.Value = strings.TrimSpace(string([]byte(tt)))