Change chemistry tag name from ce to chem

<ce> will still work, but it's deprecated.

Bug: T153606
Change-Id: Idef1078b188f2b945c9e1f8f66096779cc37133f
This commit is contained in:
Moritz Schubotz 2017-01-11 11:36:00 -08:00 committed by Amire80
parent f5778bafd2
commit 63082595d9
1 changed files with 4 additions and 2 deletions

View File

@ -166,7 +166,9 @@ class MathHooks {
*/
static function onParserFirstCallInit( $parser ) {
$parser->setHook( 'math', [ 'MathHooks', 'mathTagHook' ] );
$parser->setHook( 'ce', [ 'MathHooks', 'ceTagHook' ] );
// @deprecated the ce tag is deprecated in favour of chem cf. T153606
$parser->setHook( 'ce', [ 'MathHooks', 'chemTagHook' ] );
$parser->setHook( 'chem', [ 'MathHooks', 'chemTagHook' ] );
return true;
}
@ -411,7 +413,7 @@ class MathHooks {
* @param Parser $parser
* @return array
*/
static function ceTagHook( $content, $attributes, $parser ) {
static function chemTagHook( $content, $attributes, $parser ) {
$attributes['chem'] = true;
return MathHooks::mathTagHook( '\ce{' . $content . '}', $attributes, $parser );
}