mirror of
https://github.com/nkanaev/yarr.git
synced 2025-11-07 18:09:36 +00:00
Pull atom xhtml title from nested elements
The Atom spec says that any title marked with a type of "xhtml" should be contained in a div element[1] so we need to use the full XML text when extracting the text. [1] https://www.rfc-editor.org/rfc/rfc4287#section-3.1
This commit is contained in:
@@ -47,6 +47,8 @@ type atomLinks []atomLink
|
||||
func (a *atomText) Text() string {
|
||||
if a.Type == "html" {
|
||||
return htmlutil.ExtractText(a.Data)
|
||||
} else if a.Type == "xhtml" {
|
||||
return htmlutil.ExtractText(a.XML)
|
||||
}
|
||||
return a.Data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user