Physikerwelt has uploaded a new change for review.

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

Change subject: LaTeXML literal workaround
......................................................................

LaTeXML literal workaround

There is an API-inconsistency between different versions
of the LaTeXML damon some versions require the literal
prefix other don't allow it.

Change-Id: Id92ef141c7921a82528b3ba4384e026322499312
---
M MathLaTeXML.php
1 file changed, 6 insertions(+), 1 deletion(-)


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

diff --git a/MathLaTeXML.php b/MathLaTeXML.php
index 01c1a78..b7f59e7 100644
--- a/MathLaTeXML.php
+++ b/MathLaTeXML.php
@@ -81,7 +81,7 @@
                }
                $texcmd = rawurlencode( $tex );
                $settings = $this->serializeSettings( 
$this->getLaTeXMLSettings() );
-               $postData = $settings . '&tex=literal:' . $texcmd;
+               $postData = $settings . '&tex=' . $texcmd;
                wfDebugLog( "Math", 'Get post data: ' . $postData );
                return $postData;
        }
@@ -101,6 +101,11 @@
                $res = '';
                $host = $this->pickHost();
                $post = $this->getLaTeXMLPostData();
+               // There is an API-inconsistency between different versions of 
the LaTeXML damon
+               // some versions require the literal prefix other don't allow 
it.
+               if ( ! strpos( $host, '/convert' ) ){
+                       $post = preg_replace( '/&tex=/' , '&tex=literal:', 
$post , 1);
+               }
                $this->lastError = '';
                $requestResult = $this->makeRequest( $host, $post, $res, 
$this->lastError );
                if ( $requestResult ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id92ef141c7921a82528b3ba4384e026322499312
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: dev
Gerrit-Owner: Physikerwelt <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to