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

Improve OPML conformance #1366

Merged
merged 4 commits into from
Oct 7, 2022
Merged

Improve OPML conformance #1366

merged 4 commits into from
Oct 7, 2022

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Oct 7, 2022

  • opml/import: Use text attribute for tag names
  • opml/import: Prefer title attribute for source names
  • client: Escape error messages in OPML import
  • opml/import: Allow importing files even if browser reports wrong MIME type

Looking at an OPML file exported from Google Reader, it actually used both `title` and `text` attributes on both `[type=text]` and `[type=rss]` `outline` elements:
https://web.archive.org/web/20150106233853/https://dl.dropboxusercontent.com/u/670189/google-reader-subscriptions.xml
(obtained from https://stackoverflow.com/questions/5761771/how-do-you-extract-feed-urls-from-an-opml-file-exported-from-google-reader)

This is invalid. The OPML spec only allows `title` for `[type=rss]`

But Feedly emulates Google Reader and probably is not the only one,
judging by the single bug report with little traffic over the years,
even though it was incorrect since the initial implementation:
70d03c4

Let’s continue to use the `title` attribute for tag names as Feedly does
since non-conformant producers might neglect `text`, and fall back on
the mandatory `text` for conformant OPML files.

Fixes: #600
Falling back to `title` attribute when `text` is not present does not make sense
for valid OPML files as `text` is mandatory. Well, the attribute could still be empty
but I would still call that nonsensical.

Apparently, it was introduced for Netvibes, which only includes `title` and no `text`:
cfc6590

Let’s look at `title` first like Feedly does.
This will come in especially handy with the next commit, which will pass along messages from the XML parser.

Ideally, we would merge the import page with the rest of the APP and have React handle the escaping but we are not there yet.
… type

Some operating systems might not know about OPML and return `application/octet-stream`.
Let’s try to allow any MIME type first and only report wrong type when parsing fails.

Fixes: #730
@netlify
Copy link

netlify bot commented Oct 7, 2022

Deploy Preview for selfoss canceled.

Name Link
🔨 Latest commit eb241df
🔍 Latest deploy log https://app.netlify.com/sites/selfoss/deploys/633faba6ac4bec000891bdad

@jtojnar jtojnar merged commit eb241df into master Oct 7, 2022
@jtojnar jtojnar deleted the opml-conformance branch October 7, 2022 04:36
@jtojnar jtojnar added this to the 2.19 milestone Oct 7, 2022
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.

1 participant