]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* --getctime had bitrotted (well I only ever used it the once so far..),
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 26 May 2006 16:11:53 +0000 (16:11 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 26 May 2006 16:11:53 +0000 (16:11 +0000)
* When inlining a page in another one, links from the inlined page are now
  expanded the same as they are when rendering the inlined page as a
  standalone page. So rather than being expanded from the POV of the
  inlining page, they are expanded from the POV of the inlined page.
  For example, a link from blog/foo to "bar" will now link to blog/bar
  if it exists. Previously this needed to be a link explicitly to
  "blog/bar"; such links will also continue to work.
  (This was slightly complex to do as the link still has to be constructed
  relative to the inlining page.)

18 files changed:
IkiWiki.pm
IkiWiki/CGI.pm
IkiWiki/Plugin/brokenlinks.pm
IkiWiki/Plugin/inline.pm
IkiWiki/Plugin/orphans.pm
IkiWiki/Plugin/smiley.pm
IkiWiki/Render.pm
debian/changelog
doc/news/now_with_style.mdwn
doc/plugins/haiku.mdwn
doc/roadmap.mdwn
doc/sandbox/test.mdwn
doc/todo/done/utf8.mdwn [new file with mode: 0644]
doc/todo/multiple_templates.mdwn
doc/todo/pageindexes.mdwn
doc/todo/plugin.mdwn
doc/todo/utf8.mdwn [deleted file]
t/linkify.t

index 81a72d43d2e25a55984c39362eb87671db75b0e4..5424d435cee8fe037dd2bc38b3dd617050f253d8 100644 (file)
@@ -260,8 +260,9 @@ sub styleurl (;$) { #{{{
        return $page."style.css";
 } #}}}
 
        return $page."style.css";
 } #}}}
 
-sub htmllink ($$;$$$) { #{{{
-       my $page=shift;
+sub htmllink ($$$;$$$) { #{{{
+       my $lpage=shift; # the page doing the linking
+       my $page=shift; # the page that will contain the link (different for inline)
        my $link=shift;
        my $noimageinline=shift; # don't turn links into inline html images
        my $forcesubpage=shift; # force a link to a subpage
        my $link=shift;
        my $noimageinline=shift; # don't turn links into inline html images
        my $forcesubpage=shift; # force a link to a subpage
@@ -269,10 +270,10 @@ sub htmllink ($$;$$$) { #{{{
 
        my $bestlink;
        if (! $forcesubpage) {
 
        my $bestlink;
        if (! $forcesubpage) {
-               $bestlink=bestlink($page, $link);
+               $bestlink=bestlink($lpage, $link);
        }
        else {
        }
        else {
-               $bestlink="$page/".lc($link);
+               $bestlink="$lpage/".lc($link);
        }
 
        $linktext=pagetitle(basename($link)) unless defined $linktext;
        }
 
        $linktext=pagetitle(basename($link)) unless defined $linktext;
@@ -281,14 +282,13 @@ sub htmllink ($$;$$$) { #{{{
        
        # TODO BUG: %renderedfiles may not have it, if the linked to page
        # was also added and isn't yet rendered! Note that this bug is
        
        # TODO BUG: %renderedfiles may not have it, if the linked to page
        # was also added and isn't yet rendered! Note that this bug is
-       # masked by the bug mentioned below that makes all new files
-       # be rendered twice.
+       # masked by the bug that makes all new files be rendered twice.
        if (! grep { $_ eq $bestlink } values %renderedfiles) {
                $bestlink=htmlpage($bestlink);
        }
        if (! grep { $_ eq $bestlink } values %renderedfiles) {
                return "<span><a href=\"".
        if (! grep { $_ eq $bestlink } values %renderedfiles) {
                $bestlink=htmlpage($bestlink);
        }
        if (! grep { $_ eq $bestlink } values %renderedfiles) {
                return "<span><a href=\"".
-                       cgiurl(do => "create", page => $link, from =>$page).
+                       cgiurl(do => "create", page => $link, from => $page).
                        "\">?</a>$linktext</span>"
        }
        
                        "\">?</a>$linktext</span>"
        }
        
index 2483bf4d8de28699a24e6033beb4134af883b73f..6ead8fc56b141aba89de3c0e43bc739eb9d56c4b 100644 (file)
@@ -19,8 +19,8 @@ sub page_locked ($$;$) { #{{{
                my $locked_pages=userinfo_get($admin, "locked_pages");
                if (globlist_match($page, userinfo_get($admin, "locked_pages"))) {
                        return 1 if $nonfatal;
                my $locked_pages=userinfo_get($admin, "locked_pages");
                if (globlist_match($page, userinfo_get($admin, "locked_pages"))) {
                        return 1 if $nonfatal;
-                       error(htmllink("", $page, 1)." is locked by ".
-                             htmllink("", $admin, 1)." and cannot be edited.");
+                       error(htmllink("", "", $page, 1)." is locked by ".
+                             htmllink("", "", $admin, 1)." and cannot be edited.");
                }
        }
 
                }
        }
 
@@ -246,9 +246,9 @@ sub cgi_prefs ($$) { #{{{
        $form->field(name => "password", type => "password");
        $form->field(name => "confirm_password", type => "password");
        $form->field(name => "subscriptions", size => 50,
        $form->field(name => "password", type => "password");
        $form->field(name => "confirm_password", type => "password");
        $form->field(name => "subscriptions", size => 50,
-               comment => "(".htmllink("", "GlobList", 1).")");
+               comment => "(".htmllink("", "", "GlobList", 1).")");
        $form->field(name => "locked_pages", size => 50,
        $form->field(name => "locked_pages", size => 50,
-               comment => "(".htmllink("", "GlobList", 1).")");
+               comment => "(".htmllink("", "", "GlobList", 1).")");
        
        if (! is_admin($user_name)) {
                $form->field(name => "locked_pages", type => "hidden");
        
        if (! is_admin($user_name)) {
                $form->field(name => "locked_pages", type => "hidden");
@@ -335,7 +335,7 @@ sub cgi_editpage ($$) { #{{{
        $form->tmpl_param("can_commit", $config{rcs});
        $form->tmpl_param("indexlink", indexlink());
        $form->tmpl_param("helponformattinglink",
        $form->tmpl_param("can_commit", $config{rcs});
        $form->tmpl_param("indexlink", indexlink());
        $form->tmpl_param("helponformattinglink",
-               htmllink("", "HelpOnFormatting", 1));
+               htmllink("", "", "HelpOnFormatting", 1));
        $form->tmpl_param("styleurl", styleurl());
        $form->tmpl_param("baseurl", "$config{url}/");
        if (! $form->submitted) {
        $form->tmpl_param("styleurl", styleurl());
        $form->tmpl_param("baseurl", "$config{url}/");
        if (! $form->submitted) {
@@ -351,7 +351,7 @@ sub cgi_editpage ($$) { #{{{
                require IkiWiki::Render;
                $form->tmpl_param("page_preview",
                        htmlize($config{default_pageext},
                require IkiWiki::Render;
                $form->tmpl_param("page_preview",
                        htmlize($config{default_pageext},
-                               linkify($page, $form->field('content'))));
+                               linkify($page, $page, $form->field('content'))));
        }
        else {
                $form->tmpl_param("page_preview", "");
        }
        else {
                $form->tmpl_param("page_preview", "");
index 22590366b641b19ad8e3a34dfc1e1bacf236e93d..deee582220799b70c8f0b87e74859a71c9eb6783 100644 (file)
@@ -27,9 +27,9 @@ sub preprocess (@) { #{{{
                                my $bestlink=IkiWiki::bestlink($page, $link);
                                next if length $bestlink;
                                push @broken,
                                my $bestlink=IkiWiki::bestlink($page, $link);
                                next if length $bestlink;
                                push @broken,
-                                       IkiWiki::htmllink($page, $link, 1).
+                                       IkiWiki::htmllink($page, $page, $link, 1).
                                        " in ".
                                        " in ".
-                                       IkiWiki::htmllink($params{page}, $page, 1);
+                                       IkiWiki::htmllink($params{page}, $params{page}, $page, 1);
                        }
                }
        }
                        }
                }
        }
index a11e5a52bbb916dcef8a30396c6fedb5f8b74d88..8b67bfa61c341e0f3ee4fbb5c409c4a7cc226e5b 100644 (file)
@@ -59,7 +59,7 @@ sub preprocess_inline (@) { #{{{
        foreach my $page (blog_list($params{pages}, $params{show})) {
                next if $page eq $params{page};
                push @pages, $page;
        foreach my $page (blog_list($params{pages}, $params{show})) {
                next if $page eq $params{page};
                push @pages, $page;
-               $template->param(pagelink => htmllink($params{page}, $page));
+               $template->param(pagelink => htmllink($params{page}, $params{page}, $page));
                $template->param(content => get_inline_content($params{page}, $page))
                        if $params{archive} eq "no";
                $template->param(ctime => scalar(gmtime($pagectime{$page})));
                $template->param(content => get_inline_content($params{page}, $page))
                        if $params{archive} eq "no";
                $template->param(ctime => scalar(gmtime($pagectime{$page})));
@@ -100,7 +100,7 @@ sub get_inline_content ($$) { #{{{
        my $file=$pagesources{$page};
        my $type=pagetype($file);
        if ($type ne 'unknown') {
        my $file=$pagesources{$page};
        my $type=pagetype($file);
        if ($type ne 'unknown') {
-               return htmlize($type, linkify($parentpage, readfile(srcfile($file))));
+               return htmlize($type, linkify($page, $parentpage, readfile(srcfile($file))));
        }
        else {
                return "";
        }
        else {
                return "";
index a7aa89f58f719327586132a0131030dd1afa826e..f8035db54b2de8d64426e7e54a14593f1c78eeb8 100644 (file)
@@ -36,7 +36,7 @@ sub preprocess (@) { #{{{
        }
        
        return "All pages are linked to by other pages." unless @orphans;
        }
        
        return "All pages are linked to by other pages." unless @orphans;
-       return "<ul>\n".join("\n", map { "<li>".IkiWiki::htmllink($params{page}, $_, 1)."</li>" } sort @orphans)."</ul>\n";
+       return "<ul>\n".join("\n", map { "<li>".IkiWiki::htmllink($params{page}, $params{page}, $_, 1)."</li>" } sort @orphans)."</ul>\n";
 } # }}}
 
 1
 } # }}}
 
 1
index 5f05e3a4c2234aa053f6162f2c7eaf1028ede88b..f49c9b62f6e27b8be7665e7b78c3bfe6e77b60ba 100644 (file)
@@ -35,7 +35,7 @@ sub filter (@) { #{{{
        my %params=@_;
        
        $params{content} =~ s{(?<=\s)(\\?)$smiley_regexp(?=\s)}{
        my %params=@_;
        
        $params{content} =~ s{(?<=\s)(\\?)$smiley_regexp(?=\s)}{
-               $1 ? $2 : IkiWiki::htmllink($params{page}, $smileys{$2}, 0, 0, $2)
+               $1 ? $2 : IkiWiki::htmllink($params{page}, $params{page}, $smileys{$2}, 0, 0, $2)
        }egs;
        
        return $params{content};
        }egs;
        
        return $params{content};
index 08f5e7e951245e7b35b237db99ac76949c3aa2cb..df08eb49c496aa31163e313c49451dab320258b0 100644 (file)
@@ -7,13 +7,14 @@ use strict;
 use File::Spec;
 use IkiWiki;
 
 use File::Spec;
 use IkiWiki;
 
-sub linkify ($$) { #{{{
+sub linkify ($$$) { #{{{
+       my $lpage=shift;
        my $page=shift;
        my $content=shift;
 
        $content =~ s{(\\?)$config{wiki_link_regexp}}{
        my $page=shift;
        my $content=shift;
 
        $content =~ s{(\\?)$config{wiki_link_regexp}}{
-               $2 ? ( $1 ? "[[$2|$3]]" : htmllink($page, titlepage($3), 0, 0, pagetitle($2)))
-                  : ( $1 ? "[[$3]]" :    htmllink($page, titlepage($3)))
+               $2 ? ( $1 ? "[[$2|$3]]" : htmllink($lpage, $page, titlepage($3), 0, 0, pagetitle($2)))
+                  : ( $1 ? "[[$3]]" :    htmllink($lpage, $page, titlepage($3)))
        }eg;
        
        return $content;
        }eg;
        
        return $content;
@@ -181,7 +182,7 @@ sub genpage ($$$) { #{{{
                $actions++;
        }
        if ($config{discussion}) {
                $actions++;
        }
        if ($config{discussion}) {
-               $template->param(discussionlink => htmllink($page, "Discussion", 1, 1));
+               $template->param(discussionlink => htmllink($page, $page, "Discussion", 1, 1));
                $actions++;
        }
 
                $actions++;
        }
 
@@ -267,7 +268,7 @@ sub render ($) { #{{{
                
                $links{$page}=[findlinks($page, $content)];
                
                
                $links{$page}=[findlinks($page, $content)];
                
-               $content=linkify($page, $content);
+               $content=linkify($page, $page, $content);
                $content=preprocess($page, $content);
                $content=htmlize($type, $content);
                
                $content=preprocess($page, $content);
                $content=htmlize($type, $content);
                
index 5be298136d425b641c7c81854badde799b11002a..f35314afe31e3653e82ee1909249405922b3075d 100644 (file)
@@ -19,12 +19,23 @@ ikiwiki (1.4) UNRELEASED; urgency=low
   * Enable full utf-8 support for page input and output.
   * Add a workaround for markdown, which does not work well with utf-8
     strings.
   * Enable full utf-8 support for page input and output.
   * Add a workaround for markdown, which does not work well with utf-8
     strings.
-  * --getctime had bitrotted (well I only ever used it the once so far..), 
+  * --getctime had bitrotted (well I only ever used it the once so far..),
     fix and make it a bit more flexible
   * rcs_getctime is changed, now rather than needing to loop over all pages,
     it should just use the rcs to get the ctime of the passed file.
     fix and make it a bit more flexible
   * rcs_getctime is changed, now rather than needing to loop over all pages,
     it should just use the rcs to get the ctime of the passed file.
+  * When inlining a page in another one, links from the inlined page are now
+    expanded the same as they are when rendering the inlined page as a
+    standalone page. So rather than being expanded from the POV of the
+    inlining page, they are expanded from the POV of the inlined page.
 
 
- -- Joey Hess <joeyh@debian.org>  Fri, 26 May 2006 04:49:49 -0400
+    For example, a link from blog/foo to "bar" will now link to blog/bar
+    if it exists. Previously this needed to be a link explicitly to 
+    "blog/bar"; such links will also continue to work.
+
+    (This was slightly complex to do as the link still has to be constructed
+    relative to the inlining page.)
+
+ -- Joey Hess <joeyh@debian.org>  Fri, 26 May 2006 11:43:08 -0400
 
 ikiwiki (1.3) unstable; urgency=low
 
 
 ikiwiki (1.3) unstable; urgency=low
 
index 9f423768344d795d84ac291666906d9e130b7a36..f04530163d80d2d24a4a32bc2df767e0b8dca5b1 100644 (file)
@@ -1 +1,3 @@
-Ikiwiki also supports style sheets now. I've not done too much with the default style sheet, but you can customise [[style.css]] to do whatever you like with the look of your wiki.
\ No newline at end of file
+Ikiwiki also supports style sheets now. I've not done too much with the
+default style sheet, but you can customise [[style.css]] to do whatever you
+like with the look of your wiki.
index 5a9f89c6f351391addb805b213fcc394fdfca915..be462645b2396fd13c0a8a8e9c9dcd56d5a6d480 100644 (file)
@@ -8,7 +8,9 @@ what to write the haiku about. If no hint is given, it might base it on the
 page name. Since the vocabulary it knows is very small, many hints won't
 affect the result at all.
 
 page name. Since the vocabulary it knows is very small, many hints won't
 affect the result at all.
 
-This plugin is included in ikiwiki, but is not enabled by default.
+This plugin is included in ikiwiki, but is not enabled by default. As a
+special bonus, enabling this plugin makes any error messages ikiwiki should
+display be written in haiku.
 
 You need to have the Coy module installed for this plugin to do anything
 interesting. That does all the heavy lifting.
 
 You need to have the Coy module installed for this plugin to do anything
 interesting. That does all the heavy lifting.
index 338ccd0be8f8e2e4b01ada4b4a37f91ad38c3680..8e9c5b4622f4960454c3c8fee40f46d3ef5fbbd5 100644 (file)
@@ -13,8 +13,8 @@ Released 29 April 2006.
 
 * Unit test suite (with tests of at least core stuff like
   [[GlobList]]).
 
 * Unit test suite (with tests of at least core stuff like
   [[GlobList]]).
-* [[todo/Plugin]] mechanism. 
-* Should have fully working [[todo/utf8]] support.
+* [[Plugins]] 
+* Should have fully working [[todo/done/utf8]] support.
 * [[Optimised_rendering|todo/optimisations]] if possible. Deal with other scalability issues.
 * improved [[todo/html]] stylesheets and templates
 * A version of the logo in a different font, possibly with the dots on the i's highlighted in some other color.
 * [[Optimised_rendering|todo/optimisations]] if possible. Deal with other scalability issues.
 * improved [[todo/html]] stylesheets and templates
 * A version of the logo in a different font, possibly with the dots on the i's highlighted in some other color.
index 3b53e07e058205c81b4cfb4c34290585dca908ab..3bbc982de476b77d993f249b5e9c37b2af41df7e 100644 (file)
@@ -1 +1 @@
-This is a [[SubPage]] of the [[SandBox]].
\ No newline at end of file
+This page, [[test]], is a [[SubPage]] of the [[SandBox]].
diff --git a/doc/todo/done/utf8.mdwn b/doc/todo/done/utf8.mdwn
new file mode 100644 (file)
index 0000000..b49bb33
--- /dev/null
@@ -0,0 +1,13 @@
+ikiwiki should support utf-8 pages, both input and output. To test, here's a
+utf-8 smiley:
+
+# ☺
+
+Currently ikiwiki is belived to be utf-8 clean itself; it tells perl to use
+binmode when reading possibly binary files (such as images) and it uses
+utf-8 compatable regexps etc.
+
+Notes:
+
+* Apache "AddDefaultCharset on" settings will not play well with utf-8
+  pages. Turn it off.
index 809a089eb1fb3af146d14bf4eafe53f30cf0a66a..459a5fa4ff1ebdcebde0106169c9ed6e1c06990f 100644 (file)
@@ -4,3 +4,6 @@
 
 Well, that would probably be fairly easy to add if it used globlists to
 specify which pages use the non-default template.
 
 Well, that would probably be fairly easy to add if it used globlists to
 specify which pages use the non-default template.
+
+Hmm, I think the pagetemplate hook should allow one to get close enough to
+this in a plugin now.
index ac4c460aee2a8f7ab7650b30115fcb5a09035e6c..c4a9df9a3a14b9b03b794e189728573797915f01 100644 (file)
@@ -1,2 +1,3 @@
 Might be nice to support automatically generating an index based on headers
 Might be nice to support automatically generating an index based on headers
-in a page, for long pages. The question is, how to turn on such an index? Well, make it a [[plugin]] enabled by a [[preprocessordirective]].
+in a page, for long pages. The question is, how to turn on such an index?
+Well, make it a [[plugin]] enabled by a [[preprocessordirective]].
index fc0107b6f9f29ea078b5fbb9140c7cf894034de2..03183d1193b1ba843d7faf526fbe1739d875e896 100644 (file)
@@ -1,8 +1,8 @@
 Suggestions of ideas for plugins:
 
 * list of registered users - tricky because it sorta calls for a way to rebuild the page when a new user is registered. Might be better as a cgi?
 Suggestions of ideas for plugins:
 
 * list of registered users - tricky because it sorta calls for a way to rebuild the page when a new user is registered. Might be better as a cgi?
-* a [[todo/link_map]]
-* [[todo/sigs]] ?
+* a [[link_map]]
+* [[sigs]] ?
 * [[pageindexes]]
 * Wiki stats, such as total number of links, most linked to pages
 
 * [[pageindexes]]
 * Wiki stats, such as total number of links, most linked to pages
 
diff --git a/doc/todo/utf8.mdwn b/doc/todo/utf8.mdwn
deleted file mode 100644 (file)
index b905e46..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-ikiwiki should support utf-8 pages, both input and output. To test, here's a
-utf-8 smiley:
-
-# ☺
-
-Currently ikiwiki is belived to be utf-8 clean itself; it tells perl to use
-binmode when reading possibly binary files (such as images) and it uses
-utf-8 compatable regexps etc.
-
-utf-8 IO is not enabled by default though. While you can probably embed
-utf-8 in pages anyway, ikiwiki will not treat it right in the cases where
-it deals with things on a per-character basis (mostly when escaping and
-de-escaping special characters in filenames).
-
-To enable utf-8, edit ikiwiki and add -CSD to the perl hashbang line.
-(This should probably be configurable via a --utf8 or better --encoding=
-switch.)
-
-The following problems have been observed when running ikiwiki this way:
-
-* If invalid utf-8 creeps into a file, ikiwiki will crash rendering it as
-  follows:
-
-       Malformed UTF-8 character (unexpected continuation byte 0x97, with no preceding start byte) in substitution iterator at /usr/bin/markdown line 1317.
-       Malformed UTF-8 character (fatal) at /usr/bin/markdown line 1317.
-
-  In this example, a literal 0x97 character had gotten into a markdown
-  file.
-
-  Running this before markdown can avoid it:
-
-  $content = Encode::encode_utf8($content);
-
-  I'm not sure how, or what should be done after markdown to get the string
-  back into a form that perl can treat as utf-8.
-
-* Apache "AddDefaultCharset on" settings will not play well with utf-8
-  pages.
-
-* CGI::FormBuilder needs to be told to set `charset => "utf-8"` so that
-  utf-8 is used in the edit form. (done)
index 47eee6e0df9fed2d94836943d694435cffbffede..d1d02cd2731cb2c170871344c6438a52347c982a 100755 (executable)
@@ -1,10 +1,12 @@
 #!/usr/bin/perl
 use warnings;
 use strict;
 #!/usr/bin/perl
 use warnings;
 use strict;
-use Test::More tests => 11;
+use Test::More tests => 13;
 
 
-sub linkify ($$$) {
+sub linkify ($$$$) {
+       my $lpage=shift;
        my $page=shift;
        my $page=shift;
+
        my $content=shift;
        my @existing_pages=@{shift()};
        
        my $content=shift;
        my @existing_pages=@{shift()};
        
@@ -17,7 +19,7 @@ sub linkify ($$$) {
        }
        %IkiWiki::config=IkiWiki::defaultconfig();
 
        }
        %IkiWiki::config=IkiWiki::defaultconfig();
 
-       return IkiWiki::linkify($page, $content);
+       return IkiWiki::linkify($lpage, $page, $content);
 }
 
 sub links_to ($$) {
 }
 
 sub links_to ($$) {
@@ -62,13 +64,16 @@ sub links_text ($$) {
 
 BEGIN { use_ok("IkiWiki::Render"); }
 
 
 BEGIN { use_ok("IkiWiki::Render"); }
 
-ok(links_to("bar", linkify("foo", "link to [[bar]] ok", ["foo", "bar"])), "ok link");
-ok(not_links_to("bar", linkify("foo", "link to \\[[bar]] ok", ["foo", "bar"])), "escaped link");
-ok(links_to("page=bar", linkify("foo", "link to [[bar]] ok", ["foo"])), "broken link");
-ok(links_to("bar", linkify("foo", "link to [[baz]] and [[bar]] ok", ["foo", "baz", "bar"])), "dual links");
-ok(links_to("baz", linkify("foo", "link to [[baz]] and [[bar]] ok", ["foo", "baz", "bar"])), "dual links");
-ok(links_to("bar", linkify("foo", "link to [[some_page|bar]] ok", ["foo", "bar"])), "named link");
-ok(links_text("some page", linkify("foo", "link to [[some_page|bar]] ok", ["foo", "bar"])), "named link text");
-ok(links_to("bar", linkify("foo", "link to [[some page|bar]] ok", ["foo", "bar"])), "named link, with whitespace");
-ok(links_text("some page", linkify("foo", "link to [[some page|bar]] ok", ["foo", "bar"])), "named link text, with whitespace");
-ok(links_text("Some long, & complex page name.", linkify("foo", "link to [[Some long, & complex page name.|bar]] ok, and this is not a link]] here", ["foo", "bar"])), "complex named link text");
+ok(links_to("bar", linkify("foo", "foo", "link to [[bar]] ok", ["foo", "bar"])), "ok link");
+ok(not_links_to("bar", linkify("foo", "foo", "link to \\[[bar]] ok", ["foo", "bar"])), "escaped link");
+ok(links_to("page=bar", linkify("foo", "foo", "link to [[bar]] ok", ["foo"])), "broken link");
+ok(links_to("bar", linkify("foo", "foo", "link to [[baz]] and [[bar]] ok", ["foo", "baz", "bar"])), "dual links");
+ok(links_to("baz", linkify("foo", "foo", "link to [[baz]] and [[bar]] ok", ["foo", "baz", "bar"])), "dual links");
+ok(links_to("bar", linkify("foo", "foo", "link to [[some_page|bar]] ok", ["foo", "bar"])), "named link");
+ok(links_text("some page", linkify("foo", "foo", "link to [[some_page|bar]] ok", ["foo", "bar"])), "named link text");
+ok(links_to("bar", linkify("foo", "foo", "link to [[some page|bar]] ok", ["foo", "bar"])), "named link, with whitespace");
+ok(links_text("some page", linkify("foo", "foo", "link to [[some page|bar]] ok", ["foo", "bar"])), "named link text, with whitespace");
+ok(links_text("Some long, & complex page name.", linkify("foo", "foo", "link to [[Some long, & complex page name.|bar]] ok, and this is not a link]] here", ["foo", "bar"])), "complex named link text");
+ok(links_to("foo/bar", linkify("foo/item", "foo", "link to [[bar]] ok", ["foo", "foo/item", "foo/bar"])), "inline page link");
+ok(links_to("bar", linkify("foo", "foo", "link to [[bar]] ok", ["foo", "foo/item", "foo/bar"])), "same except not inline");
+