Przeglądaj źródła

Use internal XML workarounds to detect feed format

Kebin Liu 6 lat temu
rodzic
commit
8cebd985a2
1 zmienionych plików z 2 dodań i 4 usunięć
  1. 2 4
      reader/parser/format.go

+ 2 - 4
reader/parser/format.go

@@ -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.Entity = xml.HTMLEntity
-	decoder.CharsetReader = encoding.CharsetReader
+	decoder := rxml.NewDecoder(strings.NewReader(data))
 
 
 	for {
 	for {
 		token, _ := decoder.Token()
 		token, _ := decoder.Token()