Merge pull request #28 from hexmode/editorconfig

Add editorconfig file for MW defaults
这个提交包含在:
Jmnote 2020-11-11 13:44:58 +09:00 提交者 GitHub
当前提交 0cb4e822d2
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23
共有 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'];
}
}