Tighten farkup a bit

db4
Slava Pestov 2008-05-01 16:23:52 -05:00
parent d3660002c5
commit 0994c4f29e
1 changed files with 5 additions and 1 deletions
extra/farkup

View File

@ -63,8 +63,12 @@ MEMO: eq ( -- parser )
] with-html-stream
] with-string-writer ;
: check-url ( href -- href' )
dup { "http://" "https://" "ftp://" } [ head? ] with contains?
[ drop "/" ] unless ;
: escape-link ( href text -- href-esc text-esc )
>r escape-quoted-string r> escape-string ;
>r check-url escape-quoted-string r> escape-string ;
: make-link ( href text -- seq )
escape-link