From: Brion Vibber Date: Tue, 6 Feb 2007 07:45:06 +0000 (+0000) Subject: * (bug 8897) Fix whitespace removal for interlanguage links with link prefix X-Git-Tag: 1.31.0-rc.0~54113 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=35f4c25b3f0375933275b3516ea0c1fe92506950;p=lhc%2Fweb%2Fwiklou.git * (bug 8897) Fix whitespace removal for interlanguage links with link prefix --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8b84ab5d15..89f0dedccc 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/Parser.php b/includes/Parser.php index 66d6eb16c7..e975359911 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -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; } diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 5162b360ea..4ddaac243b 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -1566,6 +1566,53 @@ Interwiki link with fragment (bug 2130)

!! end +!! test +Interlanguage link +!! input +Blah blah blah +[[zh:Chinese]] +!!result +

Blah blah blah +

+!! end + +!! test +Double interlanguage link +!! input +Blah blah blah +[[es:Spanish]] +[[zh:Chinese]] +!!result +

Blah blah blah +

+!! end + +!! test +Interlanguage link, with prefix links +!! options +language=ln +!! input +Blah blah blah +[[zh:Chinese]] +!!result +

Blah blah blah +

+!! end + +!! test +Double interlanguage link, with prefix links (bug 8897) +!! options +language=ln +!! input +Blah blah blah +[[es:Spanish]] +[[zh:Chinese]] +!!result +

Blah blah blah +

+!! end + + ## ## XHTML tidiness ###