diff options
-rw-r--r-- | IkiWiki.pm | 18 | ||||
-rw-r--r-- | doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn | 5 |
2 files changed, 15 insertions, 8 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index adae5d8c1..5355b838d 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -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 index 000000000..73213209a --- /dev/null +++ b/doc/bugs/Links_to_missing_pages_should_always_be_styled.mdwn @@ -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]] |