diff --git a/basis/farkup/farkup-tests.factor b/basis/farkup/farkup-tests.factor index 0280c1a08d..e25fa34960 100644 --- a/basis/farkup/farkup-tests.factor +++ b/basis/farkup/farkup-tests.factor @@ -3,6 +3,10 @@ USING: farkup kernel peg peg.ebnf tools.test namespaces ; IN: farkup.tests +relative-link-prefix off +disable-images? off +link-no-follow? off + [ "Baz" ] [ "Foo/Bar/Baz" simple-link-title ] unit-test [ "Baz" ] [ "Baz" simple-link-title ] unit-test @@ -105,3 +109,12 @@ IN: farkup.tests [ "
Feature comparison:
a | Factor | Java | Lisp |
Coolness | Yes | No | No |
Badass | Yes | No | No |
Enterprise | Yes | Yes | No |
Kosher | Yes | No | Yes |
This wiki is written in Factor and is hosted on a http://linode.com virtual server.
" +] [ + "This wiki is written in [[Factor]] and is hosted on a [[http://linode.com|http://linode.com]] virtual server." + convert-farkup +] unit-test + +[ "" ] [ "[[a]] [[b|c]]" convert-farkup ] unit-test diff --git a/basis/farkup/farkup.factor b/basis/farkup/farkup.factor index 154ab0db00..4d6ac127ad 100644 --- a/basis/farkup/farkup.factor +++ b/basis/farkup/farkup.factor @@ -67,15 +67,17 @@ inline-code = "%" (!("%" | nl).)+ "%" escaped-char = "\" . => [[ second ]] -image-link = "[[image:" (!("|") .)+ "|" (!("]]").)+ "]]" +link-content = (!("|"|"]").)+ + +image-link = "[[image:" link-content "|" link-content "]]" => [[ [ second >string ] [ fourth >string ] bi image boa ]] - | "[[image:" (!("]").)+ "]]" + | "[[image:" link-content "]]" => [[ second >string f image boa ]] -simple-link = "[[" (!("|]" | "]]") .)+ "]]" +simple-link = "[[" link-content "]]" => [[ second >string dup simple-link-title link boa ]] -labelled-link = "[[" (!("|") .)+ "|" (!("]]").)+ "]]" +labelled-link = "[[" link-content "|" link-content "]]" => [[ [ second >string ] [ fourth >string ] bi link boa ]] link = image-link | labelled-link | simple-link