! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays combinators html.elements io
io.streams.string kernel math namespaces peg peg.ebnf
-sequences sequences.deep strings xml.entities xml.interpolate
+sequences sequences.deep strings xml.entities xml.literals
vectors splitting xmode.code2html urls.encoding xml.data
xml.writer ;
IN: farkup
TUPLE: line-break ;
: absolute-url? ( string -- ? )
- { "http://" "https://" "ftp://" } [ head? ] with contains? ;
+ { "http://" "https://" "ftp://" } [ head? ] with any? ;
: simple-link-title ( string -- string' )
dup absolute-url? [ "/" split1-last swap or ] unless ;
: check-url ( href -- href' )
{
{ [ dup empty? ] [ drop invalid-url ] }
- { [ dup [ 127 > ] contains? ] [ drop invalid-url ] }
+ { [ dup [ 127 > ] any? ] [ drop invalid-url ] }
{ [ dup first "/\\" member? ] [ drop invalid-url ] }
{ [ CHAR: : over member? ] [ dup absolute-url? [ drop invalid-url ] unless ] }
[ relative-link-prefix get prepend "" like ]
USING: xml.utilities 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.interpolate hashtables
+ http.client namespaces make xml.literals hashtables
calendar.format accessors continuations urls present ;
IN: syndication
[ atom-entry-link >>url ]
[
{ "content" "summary" } any-tag-named
- dup children>> [ string? not ] contains?
+ dup children>> [ string? not ] any?
[ children>> xml>string ]
[ children>string ] if >>description
]