Fix genFrac bracket sizes

* genFrac renderMML function with bracket can produce false stretching
  on Chrome
* fixed for the cases with brackets (dbinom, tbinom, binom)

Bug: T350735
Change-Id: I0939de86963fa9c226346ce15e7edf7fc4e83c68
This commit is contained in:
Stegmujo 2023-11-20 12:53:22 +00:00
parent a4c3a365af
commit 9abb258422
No known key found for this signature in database
GPG key ID: BB616B7CC84186BE
2 changed files with 8 additions and 2 deletions

View file

@ -292,10 +292,10 @@ class BaseParsing {
// tbd add props
$displayStyle = "true";
$styleAttr = [ "maxsize" => "2.047em", "minsize" => "2.047em" ];
$styleAttr = [ "minsize" => "2.047em" ];
} else {
$styleAttr = [ "maxsize" => "1.2em", "minsize" => "1.2em" ];
$styleAttr = [ "minsize" => "1.2em" ];
}
/* @phan-suppress-next-line SecurityCheck-DoubleEscaped */

View file

@ -15,6 +15,12 @@ use MediaWikiUnitTestCase;
* @covers \MediaWiki\Extension\Math\TexVC\TexVC
*/
class MMLRenderTest extends MediaWikiUnitTestCase {
public function testGenfracStretching() {
$input = "\\tbinom{n}{k} \\dbinom{n}{k} \\binom{n}{k}";
$mathMLtexVC = $this->generateMML( $input );
$this->assertStringNotContainsString( "maxsize", $mathMLtexVC );
}
public function testBracketSizes() {
$input = "\bigl( \Bigl( \biggl( \Biggl( ";
$texVC = new TexVC();