Fix for attributes in named Operator

Bug: T315978
Change-Id: I7277d03bae031ffcb2995c097f92c795cc2637dd
This commit is contained in:
Stegmujo 2023-04-05 10:07:04 +00:00
parent c9cf3814ac
commit 6e0427c2ba
No known key found for this signature in database
GPG key ID: BB616B7CC84186BE
2 changed files with 14 additions and 0 deletions

View file

@ -529,6 +529,13 @@ class BaseParsing {
$args = count( $passedArgs ) >= 1 ? $passedArgs : [ "movablelimits" => "true" ];
$texClass = TexClass::OP;
// This comes from inf case, preventing 'double'-classtag
if ( isset( $args[Tag::CLASSTAG] ) ) {
$texClass = $args[Tag::CLASSTAG];
unset( $args[Tag::CLASSTAG] );
}
if ( $name == "min" || $name == "max" || $name === "gcd" ) {
$args["form" ] = "prefix";
$texClass = "";

View file

@ -186,6 +186,13 @@ class MMLRenderTest extends MediaWikiUnitTestCase {
$this->assertStringContainsString( "<mspace linebreak=\"newline\"/>", $mathMLtexVC );
}
public function testAttributeDuplicate() {
// This checks that there is some non-erronous output caused by double class attributes
$input = "\\mu_{\\operatorname{\\inf}}";
$mathMLtexVC = $this->generateMML( $input );
$this->assertStringContainsString( "&#x3BC;", $mathMLtexVC );
}
private function generateMML( $input, $chem = false ) {
$texVC = new TexVC();
$resultT = $texVC->check( $input, [