Merge branch 'master' into autotag
authorJoey Hess <joey@kitenet.net>
Wed, 21 Apr 2010 18:21:40 +0000 (14:21 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 21 Apr 2010 18:21:40 +0000 (14:21 -0400)
IkiWiki.pm
doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn [new file with mode: 0644]

index adae5d8c10519cad951c49c0347d866856a41a91..5355b838d07b304f44e75a5b8a176c77b7575c26 100644 (file)
@@ -1087,14 +1087,16 @@ sub htmllink ($$$;@) {
                $bestlink=htmlpage($bestlink);
 
                if (! $destsources{$bestlink}) {
-                       return $linktext unless length $config{cgiurl};
-                       return "<span class=\"createlink\"><a href=\"".
-                               cgiurl(
-                                       do => "create",
-                                       page => lc($link),
-                                       from => $lpage
-                               ).
-                               "\" rel=\"nofollow\">?</a>$linktext</span>"
+                       my $cgilink = "";
+                       if (length $config{cgiurl}) {
+                               $cgilink = "<a href=\"".
+                                       cgiurl(
+                                               do => "create",
+                                               page => lc($link),
+                                               from => $lpage
+                                       )."\" rel=\"nofollow\">?</a>";
+                       }
+                       return "<span class=\"createlink\">$cgilink$linktext</span>"
                }
        }
        
diff --git a/doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn b/doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn
new file mode 100644 (file)
index 0000000..7321320
--- /dev/null
@@ -0,0 +1,5 @@
+When the CGI URL is not defined, links to missing pages appear as plain, unstyled text. I think the 'createlink' span should always wrap this text, even when the actual question mark linking to the CGI for the create action is missing. This ensures consistent styling regardless of whether the CGI is available or not (and is thus useful for example when the same wiki has clones with the CGI link and clones without).
+
+A proposed patch is available [on my ikiwiki clone](http://git.oblomov.eu/ikiwiki/patch/290d1b498f00f63e6d41218ddb76d87e68ed5081)
+
+[[!tag patch cgi done]]