Skip to content
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

accept empty xml space for content:encoded #211

Closed
wants to merge 1 commit into from

Conversation

JLugagne
Copy link

in some cases, the space is empty to use the tag namespace as default. To manage this I have added an OR conditions in rss/parser.go.

Alternative: improve goxpp to use tag namespace as xmlns default if empty ?

@mmcdole
Copy link
Owner

mmcdole commented Jul 20, 2023

@JLugagne Can you show a quick example of this? I think I understand, but want to be completely sure.

It sounds like this might be better to be fixed in goxpp, but I'd like to make sure I grok what the issue is.

@JLugagne JLugagne force-pushed the accept_empty_space branch 2 times, most recently from 9bb0d94 to 30e565b Compare July 20, 2023 06:52
@JLugagne JLugagne force-pushed the accept_empty_space branch from 30e565b to a9dcefd Compare July 20, 2023 06:53
@JLugagne
Copy link
Author

JLugagne commented Jul 20, 2023

Sure, one of the RSS feed I had to use was having xmlns:content in the root tag but in the content:enconded tag it was defining only the xmlns attribute (you can check the unit test I have added). In that case I guess that it means xmlns refer to the namespace of the tag?

cristoper added a commit to cristoper/gofeed that referenced this pull request Feb 29, 2024
PR mmcdole#220 introduced a failing test for detecting images in the "content"
element. It should instead be testing the "content:encoded" element. But
that uncovered an issue with how extensions were being detected (the
"content" namespace was being detected as an extension namespace).

As a more robust way of checking for the "content" namespace, this PR
exposes `shared.PrefixForNamspace()` as a public function so it can be
used in the rss parser. This provides a solution to PR mmcdole#211 (and
includes @JLugagne's test case from that PR).

Once the fixes to xml:base handling in mmcdole#222 are merged, this should fix
the remaining failing test reported in mmcdole#210.
cristoper added a commit to cristoper/gofeed that referenced this pull request Feb 29, 2024
PR mmcdole#220 introduced a failing test for detecting images in the "content"
element. It should instead be testing the "content:encoded" element. But
that uncovered an issue with how extensions were being detected (the
"content" namespace was being detected as an extension namespace).

As a more robust way of checking for the "content" namespace, this PR
exposes `shared.PrefixForNamspace()` as a public function so it can be
used in the rss parser. This provides a solution to PR mmcdole#211 (and
includes a test based on @JLugagne's test case from that PR).

Once the fixes to xml:base handling in mmcdole#222 are merged, this should fix
the remaining failing test reported in mmcdole#210.
cristoper added a commit to cristoper/gofeed that referenced this pull request Feb 29, 2024
PR mmcdole#220 introduced a failing test for detecting images in the "content"
element. It should instead be testing the "content:encoded" element. But
that uncovered an issue with how extensions were being detected (the
"content" namespace was being detected as an extension namespace).

As a more robust way of checking for the "content" namespace, this PR
exposes `shared.PrefixForNamspace()` as a public function so it can be
used in the rss parser. This should also fix PR mmcdole#211 (and includes
@JLugagne's test case from that PR).

Once the fixes to xml:base handling in mmcdole#222 are merged, this should fix
the remaining failing test reported in mmcdole#210.
mmcdole pushed a commit that referenced this pull request Mar 1, 2024
PR #220 introduced a failing test for detecting images in the "content"
element. It should instead be testing the "content:encoded" element. But
that uncovered an issue with how extensions were being detected (the
"content" namespace was being detected as an extension namespace).

As a more robust way of checking for the "content" namespace, this PR
exposes `shared.PrefixForNamspace()` as a public function so it can be
used in the rss parser. This should also fix PR #211 (and includes
@JLugagne's test case from that PR).

Once the fixes to xml:base handling in #222 are merged, this should fix
the remaining failing test reported in #210.
@mmcdole
Copy link
Owner

mmcdole commented Mar 1, 2024

This should be fixed with #223, so closing. Thank you @JLugagne !

@mmcdole mmcdole closed this Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants