-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance custom element handling #205
Comments
Should I also consider handling custom elements within other elements? Like, within an Should each child struct have a customelement or map? |
We also have our Perhaps we should get rid of the https://github.com/mmcdole/gofeed/blob/master/rss/parser.go#L144 |
Yes! This!Sent from my iPhoneOn Mar 25, 2023, at 5:08 PM, mmcdole ***@***.***> wrote:
We also have our extension capability that parses arbitrary extensions.
Perhaps we should get rid of the CustomElement idea and just tweak the extensions capability so it will parse anything, even non-namespaced extensions
https://github.com/mmcdole/gofeed/blob/master/rss/parser.go#L144
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Also possibly things that failed the valid rss test. Example, had to pull a source from feed recently that was text only, no url. Invalid rss so it didn’t come through. Had to do a transformation on feed to make it look like an extension. Then pass it through!Sent from my iPhoneOn Mar 25, 2023, at 8:29 PM, Rod McElrath ***@***.***> wrote:Yes! This!Sent from my iPhoneOn Mar 25, 2023, at 5:08 PM, mmcdole ***@***.***> wrote:
We also have our extension capability that parses arbitrary extensions.
Perhaps we should get rid of the CustomElement idea and just tweak the extensions capability so it will parse anything, even non-namespaced extensions
https://github.com/mmcdole/gofeed/blob/master/rss/parser.go#L144
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I get it. Not strictly valid RSS. Source with no url which is required. If you let it through some people would be surprised.But pubdate is supposed to be a standard format. Literally no one observes the standard. But the code bends over backward to get something valid.RSS standard is practically a joke. Some of the things I have seen!Sent from my iPhoneOn Mar 25, 2023, at 8:29 PM, Rod McElrath ***@***.***> wrote:Yes! This!Sent from my iPhoneOn Mar 25, 2023, at 5:08 PM, mmcdole ***@***.***> wrote:
We also have our extension capability that parses arbitrary extensions.
Perhaps we should get rid of the CustomElement idea and just tweak the extensions capability so it will parse anything, even non-namespaced extensions
https://github.com/mmcdole/gofeed/blob/master/rss/parser.go#L144
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
When gofeed encounters an element that it doesn't know expect, it will call
parseText
on it and attempt to store the value in aitem.Custom
map.parseText
calls decode element and this will fail if the the element has nested structure. The handling of this seems pretty insufficient.If we wanted to revamp custom element handling, where Gofeed encounters a tag in a feed that isn't a part of the spec, does anyone have feedback between two possible ways of representing it?
Option A - Nested Maps
Where, if it encountered this
torrent
tag, the value would look something like:Option B - Decode Element to a CustomElement struct
Where the value would be roughly:
@cristoper, @imirzadeh or @rodmcelrath do any of you have opinions on what seems like a better approach?
The text was updated successfully, but these errors were encountered: