From fb04b0ce28ad1e7314a8c90070f04896006f4934 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Tue, 24 May 2016 00:37:36 -0700 Subject: [PATCH] Parser: Use LinkRenderer for building ISBN magic links Instead of manually building the tag, use LinkRenderer to create it. Change-Id: Iaefe85527307a8399e9f52dde58fb2c24c4753c2 --- includes/parser/Parser.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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]; } -- 2.20.1