Closed sgodart closed 4 months ago
@sgodart can you include a test that demonstrates the issue at hand you are encountering?
I saw your issue you created. A test where it fails and is broken, and this PR fixes, would be much appreciated.
Hey @mmcdole, thanks for your reply. Here is a code snippet to reproduce, you should see "Error parsing feed..." in stdout :
package main
import (
"fmt"
"github.com/mmcdole/gofeed"
)
func main() {
parser := gofeed.NewParser()
_, err := parser.ParseURL("https://sportauto.autojournal.fr/feed")
if err != nil {
fmt.Printf("Error parsing feed: %s\n", err.Error())
} else {
fmt.Printf("No error\n")
}
}
The same snippet using this PR should output "No error", adding this statement in your go.mod:
replace github.com/mmcdole/gofeed => github.com/ividence/gofeed v1.2.2
hey @mmcdole, any update on this?
@sgodart greetings!
I appreciate the further details, but I was really asking for a new unit test, if you could, along with the patch.
They are specified with minimal feed representations and the expected output. So, for this, it would be a feed with an enclosure with a media tag (or similar), and then the specified parsed output.
https://github.com/mmcdole/gofeed/tree/master/testdata/parser/rss
That helps ensure any refactoring or future changes catch this issue as well and that we don't regress.
Hey @mmcdole, thanks again for your help. I've added the test files. Have a nice day.
Fix #217 Ignore all child nodes of
<enclosure>
, not only TextNodes.