CDATA is overwritten, append instead
See testcase in https://github.com/jteeuwen/go-pkg-rss/blob/master/feed_test.go of an example of where CDATA is overwritten.
This commit is contained in:
parent
f2fb9084dd
commit
f41a2d1569
|
@ -117,7 +117,7 @@ func (this *Document) LoadStream(r io.Reader, charset CharsetFunc) (err error) {
|
||||||
case xml.SyntaxError:
|
case xml.SyntaxError:
|
||||||
return errors.New(tt.Error())
|
return errors.New(tt.Error())
|
||||||
case xml.CharData:
|
case xml.CharData:
|
||||||
ct.Value = strings.TrimSpace(string([]byte(tt)))
|
ct.Value = ct.Value + strings.TrimSpace(string([]byte(tt)))
|
||||||
case xml.Comment:
|
case xml.Comment:
|
||||||
t := NewNode(NT_COMMENT)
|
t := NewNode(NT_COMMENT)
|
||||||
t.Value = strings.TrimSpace(string([]byte(tt)))
|
t.Value = strings.TrimSpace(string([]byte(tt)))
|
||||||
|
|
Loading…
Reference in New Issue