From 49ce5ff68cebb4eeec1b3137dd9e0f26020756f0 Mon Sep 17 00:00:00 2001 From: lakejason0 <36039861+lakejason0@users.noreply.github.com> Date: Wed, 19 Jun 2024 20:27:54 +0800 Subject: [PATCH 1/3] Use HookContainer instead of deprecated Hooks class --- SimpleMathJaxHooks.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SimpleMathJaxHooks.php b/SimpleMathJaxHooks.php index 6f400b12..0546bd2b 100644 --- a/SimpleMathJaxHooks.php +++ b/SimpleMathJaxHooks.php @@ -33,8 +33,9 @@ public static function renderChem($tex, array $args, Parser $parser, PPFrame $fr } private static function renderTex($tex, $parser) { + $hookContainer = MediaWiki\MediaWikiServices::getInstance()->getHookContainer(); $attributes = [ "style" => "opacity:.5" ]; - Hooks::run( "SimpleMathJaxAttributes", [ &$attributes, $tex ] ); + $hookContainer->run( "SimpleMathJaxAttributes", [ &$attributes, $tex ] ); $element = Html::Element( "span", $attributes, "[math]{$tex}[/math]" ); return [$element, 'markerType'=>'nowiki']; } From a62df694662a04677b5f7ce0b1a3365e3edcc5f4 Mon Sep 17 00:00:00 2001 From: lakejason0 <36039861+lakejason0@users.noreply.github.com> Date: Wed, 19 Jun 2024 20:40:01 +0800 Subject: [PATCH 2/3] Update SimpleMathJaxHooks.php --- SimpleMathJaxHooks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimpleMathJaxHooks.php b/SimpleMathJaxHooks.php index 0546bd2b..32822265 100644 --- a/SimpleMathJaxHooks.php +++ b/SimpleMathJaxHooks.php @@ -34,7 +34,7 @@ public static function renderChem($tex, array $args, Parser $parser, PPFrame $fr private static function renderTex($tex, $parser) { $hookContainer = MediaWiki\MediaWikiServices::getInstance()->getHookContainer(); - $attributes = [ "style" => "opacity:.5" ]; + $attributes = [ "style" => "opacity:.5", "class" => "smj-containter" ]; $hookContainer->run( "SimpleMathJaxAttributes", [ &$attributes, $tex ] ); $element = Html::Element( "span", $attributes, "[math]{$tex}[/math]" ); return [$element, 'markerType'=>'nowiki']; From 89629450e5baed4b34d82d5f932bbce0a8d5cd35 Mon Sep 17 00:00:00 2001 From: lakejason0 <36039861+lakejason0@users.noreply.github.com> Date: Wed, 19 Jun 2024 20:40:18 +0800 Subject: [PATCH 3/3] Update SimpleMathJaxHooks.php --- SimpleMathJaxHooks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimpleMathJaxHooks.php b/SimpleMathJaxHooks.php index 32822265..71b217bd 100644 --- a/SimpleMathJaxHooks.php +++ b/SimpleMathJaxHooks.php @@ -34,7 +34,7 @@ public static function renderChem($tex, array $args, Parser $parser, PPFrame $fr private static function renderTex($tex, $parser) { $hookContainer = MediaWiki\MediaWikiServices::getInstance()->getHookContainer(); - $attributes = [ "style" => "opacity:.5", "class" => "smj-containter" ]; + $attributes = [ "style" => "opacity:.5", "class" => "smj-container" ]; $hookContainer->run( "SimpleMathJaxAttributes", [ &$attributes, $tex ] ); $element = Html::Element( "span", $attributes, "[math]{$tex}[/math]" ); return [$element, 'markerType'=>'nowiki'];