1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Improve handling of Atom text content with CDATA

This commit is contained in:
Frédéric Guillot 2021-03-20 20:38:29 -07:00 committed by fguillot
parent c8c1f05328
commit 5877048749
2 changed files with 7 additions and 5 deletions

View file

@ -231,10 +231,12 @@ func (a *atom10Text) String() string {
var content string
switch {
case strings.HasPrefix(a.InnerXML, `<![CDATA[`):
content = a.CharData
case a.Type == "", a.Type == "text", a.Type == "text/plain":
content = a.InnerXML
if strings.HasPrefix(a.InnerXML, `<![CDATA[`) {
content = html.EscapeString(a.CharData)
} else {
content = a.InnerXML
}
case a.Type == "xhtml":
if a.XHTMLRootElement.InnerXML != "" {
content = a.XHTMLRootElement.InnerXML