Handbook
Glossary
check-url ( href -- href' absolute? )
Vocabulary
farkup
Inputs
href
an
object
Outputs
href'
an
object
absolute?
an
object
Definition
USING:
combinators
kernel
math
namespaces
sequences
urls.encoding
;
IN:
farkup
:
check-url
( href -- href' absolute? )
{
{
[
dup
empty?
]
[
drop
invalid-url
f
]
}
{
[
dup
[
127
>
]
any?
]
[
drop
invalid-url
f
]
}
{
[
dup
first
"/\\"
member?
]
[
drop
invalid-url
f
]
}
{
[
58
over
member?
]
[
dup
absolute-url?
[
t
]
[
drop
invalid-url
f
]
if
]
}
[
relative-link-prefix
get
prepend
""
like
url-encode
f
]
}
cond
;