* (bug 87): Category tags produce ugly whitespace
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sat, 9 Apr 2005 00:31:40 +0000 (00:31 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sat, 9 Apr 2005 00:31:40 +0000 (00:31 +0000)
includes/Parser.php

index 1f3eb33..b4e4b73 100644 (file)
@@ -1291,7 +1291,13 @@ class Parser
                                        }
                                        $wgLinkCache->addCategoryLinkObj( $nt, $sortkey );
                                        $this->mOutput->addCategoryLink( $t );
-                                       $s .= $prefix . $trail ;
+                                       
+                                       /**
+                                        * Strip the whitespace Category links produce, see bug 87
+                                        * @todo We might want to use trim($tmp, "\n") here.
+                                        */
+                                       $tmp = $prefix . $trail;
+                                       $s .= trim($tmp) == '' ? '': $tmp;
                                        
                                        wfProfileOut( "$fname-category" );
                                        continue;