mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-12-18 10:30:51 +00:00
Merge "Fix alignments"
This commit is contained in:
commit
5dd7d8cba3
|
@ -30,6 +30,11 @@ class Literal extends TexNode {
|
|||
}
|
||||
|
||||
public function renderMML( $arguments = [], $state = [] ) {
|
||||
if ( $this->arg === " " ) {
|
||||
// Fixes https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Math/+/961711
|
||||
// And they creation of empty mo elements.
|
||||
return "";
|
||||
}
|
||||
if ( is_numeric( $this->arg ) ) {
|
||||
$mn = new MMLmn( "", $arguments );
|
||||
return $mn->encapsulateRaw( $this->arg );
|
||||
|
|
|
@ -117,7 +117,7 @@ class LocalCheckerTest extends MediaWikiIntegrationTestCase {
|
|||
public function testRunChecks() {
|
||||
$fakeContent = [
|
||||
'status' => '+',
|
||||
'mathml' => '<mi>sin</mi><mo></mo><msup><mi>x</mi><mrow data-mjx-texclass="ORD"><mn>2</mn></mrow></msup>',
|
||||
'mathml' => '<mi>sin</mi><msup><mi>x</mi><mrow data-mjx-texclass="ORD"><mn>2</mn></mrow></msup>',
|
||||
'output' => '\\sin x^{2}'
|
||||
];
|
||||
$checker = new LocalChecker( WANObjectCache::newEmpty(), '\sin x^2', 'tex' );
|
||||
|
|
|
@ -26,6 +26,13 @@ class MMLRenderTest extends MediaWikiUnitTestCase {
|
|||
$this->assertStringContainsString( "munderover", $mathMLtexVC );
|
||||
}
|
||||
|
||||
public function testScriptAlignment() {
|
||||
$input = "\log_{10} f";
|
||||
$mathMLtexVC = $this->generateMML( $input );
|
||||
$this->assertStringNotContainsString( "<mo></mo>", $mathMLtexVC );
|
||||
$this->assertStringContainsString( "<msub>", $mathMLtexVC );
|
||||
}
|
||||
|
||||
public function testNotOperatorname() {
|
||||
$input = "\\not\operatorname{R}";
|
||||
$mathMLtexVC = $this->generateMML( $input );
|
||||
|
|
Loading…
Reference in a new issue