PresentationModelSectionTrait: Use section anchor generation from code

We used to have to DIY it because the core method stripped links, but
with guessSectionNameFromStrippedText() this is no longer an issue.

This allows us to pick up the nbsp handling that was added to core in
129067c907.

Bug: T180689
Depends-On: I56b9dda805a51517549c5ed709f4bd747ca04577
Change-Id: I192218dd14464de5041ceb1c16125bbcd8f44f18
This commit is contained in:
Roan Kattouw 2017-11-22 18:14:34 -05:00
parent 0adee63a82
commit babd3f76d3

View file

@ -70,8 +70,7 @@ trait EchoPresentationModelSectionTrait {
protected function getTitleWithSection() { protected function getTitleWithSection() {
$title = $this->event->getTitle(); $title = $this->event->getTitle();
$section = $this->getParsedSectionTitle(); $section = $this->getParsedSectionTitle();
// Like Parser::guessSectionNameFromWikiText() but without the link stripping $fragment = substr( Parser::guessSectionNameFromStrippedText( $section ), 1 );
$fragment = Sanitizer::normalizeSectionNameWhitespace( $section );
if ( $section ) { if ( $section ) {
$title = Title::makeTitle( $title = Title::makeTitle(
$title->getNamespace(), $title->getNamespace(),