X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FLinker.php;h=84e3103c65f45425dabd0e72279196ec2d140629;hb=41a6af704ed186a115093d2e3e9eed4ab1d81233;hp=a0332cf615cb9716f02b2f05f034a5488b6c4f89;hpb=71139c04f5d64c33f325fb49ef7af926b93cd348;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Linker.php b/includes/Linker.php index a0332cf615..84e3103c65 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1192,12 +1192,12 @@ class Linker { $section = str_replace( '[[', '', $section ); $section = str_replace( ']]', '', $section ); - $section = Sanitizer::normalizeSectionNameWhitespace( $section ); # T24784 + $section = substr( Parser::guessSectionNameFromStrippedText( $section ), 1 ); if ( $local ) { - $sectionTitle = Title::newFromText( '#' . $section ); + $sectionTitle = Title::makeTitleSafe( NS_MAIN, '', $section ); } else { $sectionTitle = Title::makeTitleSafe( $title->getNamespace(), - $title->getDBkey(), Sanitizer::decodeCharReferences( $section ) ); + $title->getDBkey(), $section ); } if ( $sectionTitle ) { $link = Linker::makeCommentLink( $sectionTitle, $wgLang->getArrow(), $wikiId, 'noclasses' ); @@ -1595,7 +1595,12 @@ class Linker { $title = wfMessage( 'toc' )->inLanguage( $lang )->escaped(); return '
' - . '

' . $title . "

\n" + . Html::openElement( 'div', [ + 'class' => 'toctitle', + 'lang' => $lang->getHtmlCode(), + 'dir' => $lang->getDir(), + ] ) + . '

' . $title . "

\n" . $toc . "\n\n"; }