Add editorconfig file for MW defaults

and tidy eol w/s
这个提交包含在:
Mark A. Hershberger 2020-11-10 21:54:56 -05:00
父节点 45d7543379
当前提交 3158d844b5
找不到此签名对应的密钥
GPG 密钥 ID: C5E6B11787B8FA01
共有 2 个文件被更改,包括 16 次插入9 次删除

12
.editorconfig 普通文件
查看文件

@ -0,0 +1,12 @@
root = true
[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

查看文件

@ -13,16 +13,16 @@ class SimpleMathJaxHooks {
$wgOut->addJsConfigVars( 'wgSmjScale', $wgSmjScale );
$wgOut->addJsConfigVars( 'wgSmjEnableMenu', $wgSmjEnableMenu );
$wgOut->addJsConfigVars( 'wgSmjDisplayAlign', $wgSmjDisplayAlign );
$parser->setHook( 'math', __CLASS__ . '::renderMath' );
if( $wgSmjUseChem ) $parser->setHook( 'chem', __CLASS__ . '::renderChem' ); }
public static function renderMath($tex, array $args, Parser $parser, PPFrame $frame ) {
global $wgSmjWrapDisplaystyle;
$tex = str_replace('\>', '\;', $tex);
$tex = str_replace('<', '\lt ', $tex);
$tex = str_replace('>', '\gt ', $tex);
if( $wgSmjWrapDisplaystyle ) $tex = "\displaystyle{ $tex }";
if( $wgSmjWrapDisplaystyle ) $tex = "\displaystyle{ $tex }";
return self::renderTex($tex, $parser);
}
@ -31,13 +31,8 @@ class SimpleMathJaxHooks {
}
private static function renderTex($tex, $parser) {
$parser->getOutput()->addModules( 'ext.SimpleMathJax' );
$parser->getOutput()->addModules( 'ext.SimpleMathJax' );
$parser->getOutput()->addModules( 'ext.SimpleMathJax.mobile' ); // For MobileFrontend
return ["<span style='opacity:.5'>[math]${tex}[/math]</span>", 'markerType'=>'nowiki'];
}
}