Merge "Change default value for $wgMathLaTeXMLUrl"

This commit is contained in:
jenkins-bot 2014-05-20 11:37:55 +00:00 committed by Gerrit Code Review
commit 86617af1db
2 changed files with 7 additions and 2 deletions

View file

@ -134,7 +134,7 @@ $wgUseMathJax = false;
* servers in an array e.g $wgMathLaTeXMLUrl = array ( 'http://latexml.example.com/convert',
* 'http://latexml2.example.com/convert');
*/
$wgMathLaTeXMLUrl = 'http://latexml.mathweb.org/convert';
$wgMathLaTeXMLUrl = 'http://gw125.iu.xsede.org:8888'; // Sponsored by https://www.xsede.org/
/**
* The timeout for the HTTP-Request sent to the LaTeXML to render an equation,

View file

@ -234,6 +234,11 @@ class MathLaTeXML extends MathRenderer {
wfProfileIn( __METHOD__ );
$host = self::pickHost();
$post = $this->getPostData();
// There is an API-inconsistency between different versions of the LaTeXML daemon
// 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 = '';
if ( $this->makeRequest( $host, $post, $res, $this->lastError ) ) {
$result = json_decode( $res );
@ -342,4 +347,4 @@ class MathLaTeXML extends MathRenderer {
return Xml::tags( 'span', $attribs, $mml );
}
}
}