From: Kunal Mehta Date: Tue, 24 May 2016 07:37:36 +0000 (-0700) Subject: Parser: Use LinkRenderer for building ISBN magic links X-Git-Tag: 1.31.0-rc.0~6538 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=fb04b0ce28ad1e7314a8c90070f04896006f4934;p=lhc%2Fweb%2Fwiklou.git Parser: Use LinkRenderer for building ISBN magic links Instead of manually building the tag, use LinkRenderer to create it. Change-Id: Iaefe85527307a8399e9f52dde58fb2c24c4753c2 --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 65dde2148b..26b4bd9242 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1470,10 +1470,14 @@ class Parser { ' ' => '', 'x' => 'X', ] ); - $titleObj = SpecialPage::getTitleFor( 'Booksources', $num ); - return 'ISBN $isbn"; + return $this->getLinkRenderer()->makeKnownLink( + SpecialPage::getTitleFor( 'Booksources', $num ), + "ISBN $isbn", + [ + 'class' => 'internal mw-magiclink-isbn', + 'title' => false // suppress title attribute + ] + ); } else { return $m[0]; }