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

When feed level links are relative the baseUrl option is not applied #135

Open
WetHat opened this issue Jun 11, 2024 · 1 comment
Open

Comments

@WetHat
Copy link

WetHat commented Jun 11, 2024

The attached feed uses relative links like so (see also the attached feed XML). The feed level link looks like this:

<link>/blog/</link>

The feed extractor returns this link as is, and does not use the baseUrl property provided with parsing options. While using relative links in RSS feed is highly questionable, the extractor should use the baseUrl on the feed level too.

This issue can be worked around by providing custom processing like so:

if (link) {
    this.site = link.startsWith("/") && options.baseUrl ? options.baseUrl + link : link;
}

feed.zip

@WetHat WetHat changed the title Link property empty if links are relative When feed level links are relative the baseUrl option is not applied Jun 11, 2024
@ndaidong
Copy link
Collaborator

Yes, thank you for you notice. It should cover this case.

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

No branches or pull requests

2 participants