Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

jatom.js: fix 'link' population #22

Closed
wants to merge 2 commits into from
Closed

Conversation

simonsj
Copy link

@simonsj simonsj commented Jun 19, 2013

Fix jatom.js to adhere to RFC 4287 for 'link' population.

Before this change, the logic for finding the 'link' for
an atom entry would just grab the first 'link'-type node
from a given entry. But an entry may have multiple 'link'
nodes; one needs to grab the '<link rel="alternate" ....'
node for that case.

An example feed that uses multiple 'link' nodes (emitted
'link' field is wrong before this change):

Before this change, the logic for finding the 'link' for
an atom entry would just grab the first 'link'-type node
from a given entry.  But an entry may have multiple 'link'
nodes; one needs to grab the '<link rel="alternate" ....'
node.

 * http://www.xml.com/pub/a/2004/06/16/dive.html

   -> "Every Atom feed and every Atom entry needs an
       alternate link. It is the only type of link that
       is required by the Atom feed specification."

An example feed that uses multiple 'link' nodes (emitted
'link' field is wrong before this change):

 * http://blog.racket-lang.org/feeds/posts/default
Fix jatom.js to adhere to RFC 4287 for 'link' population.

Before this change, the logic for finding the 'link' for
an atom entry would just grab the first 'link'-type node
from a given entry.  But an entry may have multiple 'link'
nodes; one needs to grab the '<link rel="alternate" ....'
node for that case.

An example feed that uses multiple 'link' nodes (emitted
'link' field is wrong before this change):

 * http://blog.racket-lang.org/feeds/posts/default
@simonsj
Copy link
Author

simonsj commented Jun 24, 2013

The patch in simonsj/jFeed@2e5e4a8 is incomplete: link nodes are allowed to omit 'rel' attributes, in which case they're assumed to be 'alternate' links (RFC 4287; 4.2.7.2). simonsj/jFeed@9fca8c6 should correct the handling for both cases.

@simonsj
Copy link
Author

simonsj commented Feb 14, 2018

Closing as stale :).

@simonsj simonsj closed this Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant