X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FParser.php;h=49f2ce1def6e13ab3e2dfe9b9af1e880c2d1f776;hb=4795e19f8358d0f3ef2d345452fffa1f5780dc42;hp=ff4936d03523601bf94daabc46d110e230605315;hpb=2edc104f99e3960c663b2c0834e88f7df86ad794;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index ff4936d035..49f2ce1def 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -2296,8 +2296,10 @@ class Parser { $this->mOutput->addLanguageLink( $nt->getFullText() ); } - $s = rtrim( $s . $prefix ); - $s .= trim( $trail, "\n" ) == '' ? '' : $prefix . $trail; + /** + * Strip the whitespace interwiki links produce, see T10897 + */ + $s = rtrim( $s . $prefix ) . $trail; # T175416 continue; } @@ -2322,7 +2324,10 @@ class Parser { continue; } } elseif ( $ns == NS_CATEGORY ) { - $s = rtrim( $s . "\n" ); # T2087 + /** + * Strip the whitespace Category links produce, see T2087 + */ + $s = rtrim( $s . $prefix ) . $trail; # T2087, T87753 if ( $wasblank ) { $sortkey = $this->getDefaultSort(); @@ -2334,11 +2339,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; } } @@ -4204,6 +4204,8 @@ class Parser { # Save headline for section edit hint before it's escaped $headlineHint = $safeHeadline; + # Decode HTML entities + $safeHeadline = Sanitizer::decodeCharReferences( $safeHeadline ); $fallbackHeadline = Sanitizer::escapeIdForAttribute( $safeHeadline, Sanitizer::ID_FALLBACK ); $linkAnchor = Sanitizer::escapeIdForLink( $safeHeadline ); $safeHeadline = Sanitizer::escapeIdForAttribute( $safeHeadline, Sanitizer::ID_PRIMARY ); @@ -5764,6 +5766,7 @@ class Parser { # Strip out wikitext links(they break the anchor) $text = $this->stripSectionName( $text ); $text = Sanitizer::normalizeSectionNameWhitespace( $text ); + $text = Sanitizer::decodeCharReferences( $text ); return '#' . Sanitizer::escapeIdForLink( $text ); } @@ -5782,6 +5785,7 @@ class Parser { # Strip out wikitext links(they break the anchor) $text = $this->stripSectionName( $text ); $text = Sanitizer::normalizeSectionNameWhitespace( $text ); + $text = Sanitizer::decodeCharReferences( $text ); if ( isset( $wgFragmentMode[1] ) && $wgFragmentMode[1] === 'legacy' ) { // ForAttribute() and ForLink() are the same for legacy encoding