mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-23 15:16:56 +00:00
Ignore misplaced limits commands
Instead of rendering \limits or \nolimits when those commands are misplaced the commands are ignored. TeX does it the same way, but issues a warning in addition. Issuing the warning will be taken care of in a follow-up commit. Bug: T365170 Change-Id: Ic1c28be2a5669183c3dd5d15577a35a1b5a76971
This commit is contained in:
parent
18df3d31a1
commit
b058d88bf9
|
@ -930,7 +930,7 @@ class BaseParsing {
|
|||
}
|
||||
}
|
||||
$mrow = new MMLmrow( TexClass::ORD, [] );
|
||||
$opParsed = ( $operatorContent != null && $operatorContent["limits"] )
|
||||
$opParsed = ( $operatorContent["limits"] ?? false )
|
||||
? $operatorContent["limits"]->renderMML( $argsOp ) : "";
|
||||
|
||||
if ( $node instanceof DQ ) {
|
||||
|
@ -940,6 +940,9 @@ class BaseParsing {
|
|||
$munderOver = new MMLmunderover();
|
||||
return $munderOver->encapsulateRaw( $opParsed . $mrow->encapsulateRaw( $node->getDown()->renderMML() )
|
||||
. $mrow->encapsulateRaw( $node->getUp()->renderMML() ) );
|
||||
} elseif ( $name === 'limits' || $name === 'nolimits' ) {
|
||||
// Don't render limits
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -118,8 +118,7 @@ class Literal extends TexNode {
|
|||
$ret = BaseMethods::checkAndParse( $inputP, $arguments,
|
||||
array_merge( $operatorContent ?? [], $state ?? [] ),
|
||||
$this, false );
|
||||
if ( $ret ) {
|
||||
|
||||
if ( $ret || $ret === '' ) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue