* (bug 8897) Fix whitespace removal for interlanguage links with link prefix
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 6 Feb 2007 07:45:06 +0000 (07:45 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 6 Feb 2007 07:45:06 +0000 (07:45 +0000)
RELEASE-NOTES
includes/Parser.php
maintenance/parserTests.txt

index 8b84ab5..89f0ded 100644 (file)
@@ -178,6 +178,7 @@ lighter making things easier to read.
 * Clean up session checks to better handle the case where the session was
   opened during the current request. May help with some caching corner
   cases.
+* (bug 8897) Fix whitespace removal for interlanguage links with link prefix
 
 
 == Languages updated ==
index 66d6eb1..e975359 100644 (file)
@@ -1721,8 +1721,8 @@ class Parser
                                wfProfileIn( "$fname-interwiki" );
                                if( $iw && $this->mOptions->getInterwikiMagic() && $nottalk && $wgContLang->getLanguageName( $iw ) ) {
                                        $this->mOutput->addLanguageLink( $nt->getFullText() );
-                                       $s = rtrim($s . "\n");
-                                       $s .= trim($prefix . $trail, "\n") == '' ? '': $prefix . $trail;
+                                       $s = rtrim($s . $prefix);
+                                       $s .= trim($trail, "\n") == '' ? '': $prefix . $trail;
                                        wfProfileOut( "$fname-interwiki" );
                                        continue;
                                }
index 5162b36..4ddaac2 100644 (file)
@@ -1566,6 +1566,53 @@ Interwiki link with fragment (bug 2130)
 </p>
 !! end
 
+!! test
+Interlanguage link
+!! input
+Blah blah blah
+[[zh:Chinese]]
+!!result
+<p>Blah blah blah
+</p>
+!! end
+
+!! test
+Double interlanguage link
+!! input
+Blah blah blah
+[[es:Spanish]]
+[[zh:Chinese]]
+!!result
+<p>Blah blah blah
+</p>
+!! end
+
+!! test
+Interlanguage link, with prefix links
+!! options
+language=ln
+!! input
+Blah blah blah
+[[zh:Chinese]]
+!!result
+<p>Blah blah blah
+</p>
+!! end
+
+!! test
+Double interlanguage link, with prefix links (bug 8897)
+!! options
+language=ln
+!! input
+Blah blah blah
+[[es:Spanish]]
+[[zh:Chinese]]
+!!result
+<p>Blah blah blah
+</p>
+!! end
+
+
 ##
 ## XHTML tidiness
 ###