File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -345,8 +345,17 @@ private function processResponse() : void
345345 throw new \RuntimeException ('Error fetching page from MediaWiki API. ' );
346346 }
347347
348+ $ title = $ this ->responseBody ['parse ' ]['displaytitle ' ];
349+ // Fix the extra rendering in the displaytitle, when a page is not language specific
350+ $ title = str_replace ([
351+ '<span class="mw-page-title-namespace"> ' ,
352+ '<span class="mw-page-title-separator"> ' ,
353+ '<span class="mw-page-title-main"> ' ,
354+ '</span> '
355+ ], '' , $ title );
356+
348357 // Store the title to be used later
349- $ this ->title = $ this -> responseBody [ ' parse ' ][ ' displaytitle ' ] ;
358+ $ this ->title = $ title ;
350359
351360 // Store the URL slug to be used later
352361 $ this ->setPageUrlSlug ($ this ->responseBody ['parse ' ]['title ' ]);
You can’t perform that action at this time.
0 commit comments