mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-11 16:58:38 +00:00
Add explicit parentheses around mixed boolean operator
Mixing different binary boolean operators within an expression without using parentheses to clarify precedence is not allowed (T358966) Change-Id: I2e9e021bd10ddd7e1d951bf21c467499060bfc4a
This commit is contained in:
parent
4d42d55ab2
commit
572abe655b
|
@ -76,7 +76,7 @@ class JsonToMathML extends Maintenance {
|
|||
foreach ( $inputTexF as $entry ) {
|
||||
try {
|
||||
$mmlMathoid = $this->fetchMathML( $entry['tex'], $entry['type'], 'mathml' );
|
||||
if ( $this->getOption( "chem-fallback", 0 ) && !( $mmlMathoid ) || $mmlMathoid == "" ) {
|
||||
if ( ( $this->getOption( "chem-fallback", 0 ) && !$mmlMathoid ) || $mmlMathoid == "" ) {
|
||||
$mmlMathoid = $this->fetchMathML( $entry['tex'], "chem", 'mathml' );
|
||||
if ( $mmlMathoid && $mmlMathoid != "" ) {
|
||||
$entry['type'] = "chem";
|
||||
|
|
|
@ -257,7 +257,8 @@ class MathMathML extends MathRenderer {
|
|||
public function getPostData() {
|
||||
$input = $this->getTex();
|
||||
if ( $this->inputType == 'pmml' ||
|
||||
$this->getMode() == MathConfig::MODE_LATEXML && $this->getMathml() ) {
|
||||
( $this->getMode() == MathConfig::MODE_LATEXML && $this->getMathml() )
|
||||
) {
|
||||
$out = 'type=mml&q=' . rawurlencode( $this->getMathml() );
|
||||
} elseif ( $this->inputType == 'ascii' ) {
|
||||
$out = 'type=asciimath&q=' . rawurlencode( $input );
|
||||
|
|
|
@ -451,7 +451,7 @@ class MhchemStateMachines {
|
|||
$buffer["o"] ?? "" );
|
||||
$c4 = $this->mhchemParser->getPatterns()->match( '$one lowercase latin letter$ $',
|
||||
$buffer["o"] ?? "" );
|
||||
$hyphenFollows = $m === "-" && ( isset( $c1["remainder"] ) && $c1["remainder"] === ""
|
||||
$hyphenFollows = $m === "-" && ( ( isset( $c1["remainder"] ) && $c1["remainder"] === "" )
|
||||
|| isset( $c2 ) || isset( $c3 ) || isset( $c4 ) );
|
||||
if ( $hyphenFollows && !isset( $buffer["a"] ) && !isset( $buffer["b"] )
|
||||
&& !isset( $buffer["p"] ) && !isset( $buffer["d"] )
|
||||
|
|
Loading…
Reference in a new issue