X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fparser%2FParser.php;h=d00b333a16c66af72d86066c2d1429e05df56b68;hb=3df3b575c6617df64ec98533cc7141bd2314e274;hp=e901f6f311c4dedf24b81354a4ecd52814f50fbf;hpb=a3d615394c9ed51dacb77b215ba30a43358cdd62;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index e901f6f311..d00b333a16 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -2296,8 +2296,13 @@ class Parser { $this->mOutput->addLanguageLink( $nt->getFullText() ); } + /** + * Strip the whitespace interwiki links produce, see T10897 + */ $s = rtrim( $s . $prefix ); - $s .= trim( $trail, "\n" ) == '' ? '' : $prefix . $trail; + // Special case: strip newlines when only thing between + // this link and next are newlines + $s .= trim( $trail, "\n" ) === '' ? '' : $trail; continue; } @@ -2322,7 +2327,13 @@ class Parser { continue; } } elseif ( $ns == NS_CATEGORY ) { - $s = rtrim( $s . "\n" ); # T2087 + /** + * Strip the whitespace Category links produce, see T2087 + */ + $s = rtrim( $s . $prefix ); # T2087, T87753 + // Special case: strip newlines when only thing between + // this link and next are newlines + $s .= trim( $trail, "\n" ) === '' ? '' : $trail; if ( $wasblank ) { $sortkey = $this->getDefaultSort(); @@ -2334,11 +2345,6 @@ class Parser { $sortkey = $this->getConverterLanguage()->convertCategoryKey( $sortkey ); $this->mOutput->addCategory( $nt->getDBkey(), $sortkey ); - /** - * Strip the whitespace Category links produce, see T2087 - */ - $s .= trim( $prefix . $trail, "\n" ) == '' ? '' : $prefix . $trail; - continue; } }