Add Hook to add attributes to span

这个提交包含在:
Mark A. Hershberger 2020-11-10 22:19:14 -05:00
父节点 3158d844b5
当前提交 d38cd5057d
找不到此签名对应的密钥
GPG 密钥 ID: C5E6B11787B8FA01
共有 1 个文件被更改,包括 4 次插入1 次删除

查看文件

@ -33,6 +33,9 @@ class SimpleMathJaxHooks {
private static function renderTex($tex, $parser) {
$parser->getOutput()->addModules( 'ext.SimpleMathJax' );
$parser->getOutput()->addModules( 'ext.SimpleMathJax.mobile' ); // For MobileFrontend
return ["<span style='opacity:.5'>[math]${tex}[/math]</span>", 'markerType'=>'nowiki'];
$attributes = [ "style" => "opacity:.5" ];
Hooks::run( "SimpleMathJaxAttr", [ &$attributes, $tex ] );
$element = Html::Element( "span", $attributes, "[math]{$tex}[/math]" );
return [$element, 'markerType'=>'nowiki'];
}
}