syndication: Fix atom parsing.
This is the problematic feed: https://rfc1149.net/blog/tag/factor/feed/ Here's the validator saying it's ok: https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Frfc1149.net%2Fblog%2Ftag%2Ffactor%2Ffeed%2Ffreebsd-work
parent
c3569f02fa
commit
f00bc7e08c
|
@ -1,11 +1,10 @@
|
|||
! Copyright (C) 2006 Chris Double, Daniel Ehrenberg.
|
||||
! Portions copyright (C) 2008, 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: xml.traversal kernel assocs math.order strings sequences
|
||||
xml.data xml.writer io.streams.string combinators xml
|
||||
xml.entities.html io.files io http.client namespaces make
|
||||
xml.syntax hashtables calendar.format calendar.parser accessors
|
||||
continuations urls present byte-arrays ;
|
||||
USING: accessors byte-arrays calendar.format calendar.parser
|
||||
combinators combinators.short-circuit continuations http.client
|
||||
kernel present sequences strings urls xml xml.data
|
||||
xml.entities.html xml.syntax xml.traversal xml.writer ;
|
||||
IN: syndication
|
||||
|
||||
: any-tag-named ( tag names -- tag-inside )
|
||||
|
@ -65,8 +64,14 @@ TUPLE: entry title url description date ;
|
|||
[ "item" tags-named [ rss2.0-entry ] map set-entries ]
|
||||
tri ;
|
||||
|
||||
ERROR: invalid-atom-link ;
|
||||
|
||||
: atom-link ( tag -- url/f )
|
||||
"link" "alternate" "rel" tag-named-with-attr
|
||||
{
|
||||
[ "link" "alternate" "rel" tag-named-with-attr ]
|
||||
[ "link" "self" "rel" tag-named-with-attr ]
|
||||
[ "link" tag-named ]
|
||||
} 1||
|
||||
[ "href" attr >url ] [ f ] if* ;
|
||||
|
||||
: atom1.0-entry ( tag -- entry )
|
||||
|
|
Loading…
Reference in New Issue