mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-23 23:25:02 +00:00
Fix table alignment to left
* currently, \begin{align} generates <mtable columnalign="right" but it should be <mtable columnalign="left" Bug: T348791 Change-Id: Ic0df45aba4fdb6ffbdc790b5e4bc56e7daeca802
This commit is contained in:
parent
1aae7cde53
commit
9360ca94c4
|
@ -164,7 +164,9 @@ class BaseParsing {
|
|||
// this goes for name =="aligned" ... tcs: 358 420 421
|
||||
$mrow = new MMLmrow();
|
||||
// tbd how are the table args composed ?
|
||||
$tableArgs = [ "columnalign" => "right",
|
||||
|
||||
$direction = ( $name == "aligned" ) ? "left" : "right";
|
||||
$tableArgs = [ "columnalign" => $direction,
|
||||
"columnspacing" => "", "displaystyle" => "true", "rowspacing" => "3pt" ];
|
||||
$mtable = new MMLmtable( "", $tableArgs );
|
||||
$mtr = new MMLmtr();
|
||||
|
|
|
@ -15,6 +15,13 @@ use MediaWikiUnitTestCase;
|
|||
*/
|
||||
class MMLRenderTest extends MediaWikiUnitTestCase {
|
||||
|
||||
public function testAlignLeft() {
|
||||
$input = " \begin{align} f(x) & = (a+b)^2 \\ & = a^2+2ab+b^2 \\ \\end{align} ";
|
||||
$mathMLtexVC = $this->generateMML( $input );
|
||||
$this->assertStringContainsString( "columnalign=\"left\"", $mathMLtexVC );
|
||||
$this->assertStringContainsString( "mtable", $mathMLtexVC );
|
||||
}
|
||||
|
||||
public function testLeftRightAttributes() {
|
||||
$input = "\\left( \\right) \\left[ \\right]";
|
||||
$mathMLtexVC = $this->generateMML( $input );
|
||||
|
|
Loading…
Reference in a new issue