Physikerwelt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/165945

Change subject: Temporary fix to correct non well formed XML markup
......................................................................

Temporary fix to correct non well formed XML markup

Change-Id: I0362779a3b3db48a64fd4aca6230c317617e281d
---
M MathMathML.php
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/45/165945/1

diff --git a/MathMathML.php b/MathMathML.php
index b57d738..ad70c16 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -241,9 +241,12 @@
                        $jsonResult = json_decode( $res );
                        if ( $jsonResult && json_last_error() === 
JSON_ERROR_NONE ) {
                                if ( $jsonResult->success ) {
+                                       // temporary fix to replace non well 
formed XML generated by MathJax
+                                       $mml = preg_replace( 
'/displaystyle="true" displaystyle="true"/' , 'displaystyle="true"' ,
+                                               $jsonResult->mml );
                                        if ( $this->getMode() == 
MW_MATH_LATEXML ||
                                                        $this->inputType == 
'pmml' ||
-                                                       $this->isValidMathML( 
$jsonResult->mml ) ) {
+                                                       $this->isValidMathML( 
$mml ) ) {
                                                $xmlObject = new XmlTypeCheck( 
$jsonResult->svg, null, false );
                                                if ( ! $xmlObject->wellFormed ) 
{
                                                        $this->lastError = 
$this->getError( 'math_invalidxml', $host );
@@ -255,7 +258,7 @@
                                                        $this->setLog( 
$jsonResult->log );
                                                }
                                                if ( $this->getMode() != 
MW_MATH_LATEXML && $this->inputType != 'pmml') {
-                                                       $this->setMathml( 
$jsonResult->mml );
+                                                       $this->setMathml( $mml 
);
                                                }
                                                return true;
                                        } else {

-- 
To view, visit https://gerrit.wikimedia.org/r/165945
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0362779a3b3db48a64fd4aca6230c317617e281d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <w...@physikerwelt.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to