]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Always give createlink class to links to nonexistent pages
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Tue, 20 Apr 2010 22:16:32 +0000 (00:16 +0200)
committerJoey Hess <joey@kitenet.net>
Wed, 21 Apr 2010 16:49:31 +0000 (12:49 -0400)
With this change, the <span> with class createlink is always created
around the link text, even when no CGI URL is defined. This allows
styling of these 'links' in this case too. The same class is used as when
CGI URL is defined so that e.g. clones of the same ikiwiki, one with CGI
and one without, display in the same way (modulo the missing question mark
link).
(cherry picked from commit 290d1b498f00f63e6d41218ddb76d87e68ed5081)

IkiWiki.pm

index 6d3b6c60688d9b8a785505a4603e6929783dab04..ba2c09c369956579175cf8dd50a0f5308923f05a 100644 (file)
@@ -1086,14 +1086,16 @@ sub htmllink ($$$;@) {
                $bestlink=htmlpage($bestlink);
 
                if (! $destsources{$bestlink}) {
-                       return $linktext unless length $config{cgiurl};
-                       return "<span class=\"createlink\"><a href=\"".
+                       my $cgilink = "";
+                       if (length $config{cgiurl}) {
+                               $cgilink = "<a href=\"".
                                cgiurl(
                                        do => "create",
                                        page => lc($link),
                                        from => $lpage
-                               ).
-                               "\" rel=\"nofollow\">?</a>$linktext</span>"
+                               )."\" rel=\"nofollow\">?</a>";
+                       }
+                       return "<span class=\"createlink\">$cgilink$linktext</span>"
                }
        }