From 5b67454ed97e78399aac81c18a1a912eda9cb06b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 9 Apr 2005 00:31:40 +0000 Subject: [PATCH] * (bug 87): Category tags produce ugly whitespace --- includes/Parser.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/Parser.php b/includes/Parser.php index 1f3eb330a8..b4e4b7317d 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -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; -- 2.20.1