1
0
Fork 0

Use internal XML workarounds to detect feed format

This commit is contained in:
Kebin Liu 2020-01-03 14:19:15 +08:00 committed by Frédéric Guillot
parent 6ff617a733
commit 8cebd985a2

View file

@ -8,7 +8,7 @@ import (
"encoding/xml" "encoding/xml"
"strings" "strings"
"miniflux.app/reader/encoding" rxml "miniflux.app/reader/xml"
) )
// List of feed formats. // List of feed formats.
@ -26,9 +26,7 @@ func DetectFeedFormat(data string) string {
return FormatJSON return FormatJSON
} }
decoder := xml.NewDecoder(strings.NewReader(data)) decoder := rxml.NewDecoder(strings.NewReader(data))
decoder.Entity = xml.HTMLEntity
decoder.CharsetReader = encoding.CharsetReader
for { for {
token, _ := decoder.Token() token, _ := decoder.Token()