mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-23 15:16:56 +00:00
Overwrite spacing for divide
This overwrite should be removed once this is the
default in all browsers.
Bug: T375337
Change-Id: I5ab133f0368ed6eef94b0a87281bb9129fca406c
(cherry picked from commit 758f9c987a
)
This commit is contained in:
parent
473064eaa7
commit
0658c42bf5
|
@ -131,6 +131,9 @@ class BaseMethods {
|
|||
// see: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Math/+/961213
|
||||
$mspace = new MMLmspace( "", [ "width" => "0.5em" ] );
|
||||
return $mspace->getEmpty();
|
||||
case '/':
|
||||
$mmlMo = new MMLmo( '', [ 'lspace' => '0', 'rspace' => '0' ] );
|
||||
return $mmlMo->encapsulateRaw( $input );
|
||||
}
|
||||
return $input;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ class OperatorDictionary {
|
|||
'->' => [ " exports.MO.BIN5" ],
|
||||
'.' => [ " [0, 3], MmlNode_js_1.TEXCLASS.PUNCT\"], { separator=> [ true }]" ],
|
||||
':' => [ " [1, 2], MmlNode_js_1.TEXCLASS.REL\"], null]" ],
|
||||
'/' => [ " exports.MO.ORD11" ],
|
||||
'/' => [ " exports.MO.ORD11", true ],
|
||||
'//' => [ " OPDEF(1\"], 1)" ],
|
||||
'/=' => [ " exports.MO.BIN4" ],
|
||||
'=>' => [ " [1, 2], MmlNode_js_1.TEXCLASS.REL\"], null]" ],
|
||||
|
|
|
@ -124,4 +124,13 @@ class LiteralTest extends MediaWikiUnitTestCase {
|
|||
'exclamation mark should render as special operator.' );
|
||||
}
|
||||
|
||||
public function testDivide() {
|
||||
$n = new Literal( '/' );
|
||||
$real = $n->renderMML();
|
||||
$this->assertStringContainsString( '/</mo>', $real,
|
||||
'divide should render as special operator.' );
|
||||
$this->assertStringContainsString( 'lspace="0" rspace="0"', $real,
|
||||
'divide should have no spacing.' );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue