1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-12 16:58:36 +00:00

Add <head> tag to OPML export

This commit is contained in:
Frédéric Guillot 2021-12-16 11:42:43 -08:00
parent 47b47cc32c
commit 0f6f4c8c60
4 changed files with 79 additions and 66 deletions

View file

@ -14,16 +14,16 @@ import (
// Parse reads an OPML file and returns a SubcriptionList.
func Parse(data io.Reader) (SubcriptionList, *errors.LocalizedError) {
feeds := new(opml)
opmlDocument := NewOPMLDocument()
decoder := xml.NewDecoder(data)
decoder.Entity = xml.HTMLEntity
decoder.Strict = false
decoder.CharsetReader = encoding.CharsetReader
err := decoder.Decode(feeds)
err := decoder.Decode(opmlDocument)
if err != nil {
return nil, errors.NewLocalizedError("Unable to parse OPML file: %q", err)
}
return feeds.Transform(), nil
return opmlDocument.GetSubscriptionList(), nil
}