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

Use xml:base for relative URLs #692

Open
delan opened this issue Sep 24, 2024 · 0 comments
Open

Use xml:base for relative URLs #692

delan opened this issue Sep 24, 2024 · 0 comments

Comments

@delan
Copy link

delan commented Sep 24, 2024

Atom spec says:

Any element defined by this specification MAY have an xml:base
attribute [W3C.REC-xmlbase-20010627]. When xml:base is used in an
Atom Document, it serves the function described in section 5.1.1 of
[RFC3986], establishing the base URI (or IRI) for resolving any
relative references found within the effective scope of the xml:base
attribute.

Right now, if you have a feed like this published at https://example.com/feed.xml, the images will load in Thunderbird and FreshRSS (https://example.com/posts/images/bird.jpg), but not fluent-reader (https://example.com/images/bird.jpg). Those other clients even handle relative URLs without xml:base, but I don’t think that’s guaranteed by the spec.

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<updated>2024-09-24T14:35:15.950Z</updated>
<title>feed</title>
<entry>
<id>https://example.com/posts/123.html</id>
<link rel="alternate" href="https://example.com/posts/123.html"/>
<published>2024-09-21T14:36:37.520Z</published>
<title>entry</title>
<content type="html" xml:base="https://example.com/posts/">
&lt;img src=&quot;images/bird.jpg&quot;&gt;
</content>
</entry>
</feed>

One workaround that fluent-reader accepts is to add a <base> tag inside the <content>:

<content type="html" xml:base="https://example.com/posts/">
&lt;base href="https://example.com/posts/"&gt;
&lt;img src=&quot;images/bird.jpg&quot;&gt;
</content>
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

1 participant