Skip to content

Commit

Permalink
Merge pull request #43 from lakejason0/patch-1
Browse files Browse the repository at this point in the history
Use HookContainer instead of deprecated Hooks class
  • Loading branch information
jmnote authored Jul 2, 2024
2 parents 0b5e165 + 8962945 commit fab35e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SimpleMathJaxHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ public static function renderChem($tex, array $args, Parser $parser, PPFrame $fr
}

private static function renderTex($tex, $parser) {
$attributes = [ "style" => "opacity:.5" ];
Hooks::run( "SimpleMathJaxAttributes", [ &$attributes, $tex ] );
$hookContainer = MediaWiki\MediaWikiServices::getInstance()->getHookContainer();
$attributes = [ "style" => "opacity:.5", "class" => "smj-container" ];
$hookContainer->run( "SimpleMathJaxAttributes", [ &$attributes, $tex ] );
$element = Html::Element( "span", $attributes, "[math]{$tex}[/math]" );
return [$element, 'markerType'=>'nowiki'];
}
Expand Down

0 comments on commit fab35e6

Please sign in to comment.