1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

Try to use outermost element text when title is empty

This commit is contained in:
lf94 2022-04-05 21:22:06 -04:00 committed by Frédéric Guillot
parent ec2b911881
commit fa8431c5c6
2 changed files with 36 additions and 3 deletions

View file

@ -245,7 +245,12 @@ func (a *atom10Text) String() string {
content = a.InnerXML
}
case a.Type == "xhtml":
content = a.XHTMLRootElement.InnerXML
var root = a.XHTMLRootElement
if root.XMLName.Local == "div" {
content = root.InnerXML
} else {
content = a.InnerXML
}
default:
content = a.CharData
}
@ -254,5 +259,6 @@ func (a *atom10Text) String() string {
}
type atomXHTMLRootElement struct {
InnerXML string `xml:",innerxml"`
XMLName xml.Name `xml:"div"`
InnerXML string `xml:",innerxml"`
}