* Update to Esperanto translation (eo)
* Check for preg_match() existence when installing and die out whining about PCRE
if it's not there, instead of throwing a fatal error
+* (bug 672) Add MathAfterTexvc hook
== Compatibility ==
$wcOnlySysopsCanPatrol: config setting indicating whether the user
must be a sysop to patrol the edit
+'MathAfterTexvc': after texvc is executed when rendering mathematics
+$mathRenderer: instance of MathRenderer
+$errmsg: error message, in HTML (string). Nonempty indicates failure
+ of rendering the formula
+
'OutputPageBeforeHTML': a page has been processed by the parser and
the resulting HTML is about to be displayed.
$parserOutput: the parserOutput (object) that corresponds to the page
}
$retval = substr ($contents, 0, 1);
+ $errmsg = '';
if (($retval == 'C') || ($retval == 'M') || ($retval == 'L')) {
if ($retval == 'C')
$this->conservativeness = 2;
} else {
$errbit = htmlspecialchars( substr($contents, 1) );
switch( $retval ) {
- case 'E': return $this->_error( 'math_lexing_error', $errbit );
- case 'S': return $this->_error( 'math_syntax_error', $errbit );
- case 'F': return $this->_error( 'math_unknown_function', $errbit );
- default: return $this->_error( 'math_unknown_error', $errbit );
+ case 'E': $errmsg = $this->_error( 'math_lexing_error', $errbit );
+ case 'S': $errmsg = $this->_error( 'math_syntax_error', $errbit );
+ case 'F': $errmsg = $this->_error( 'math_unknown_function', $errbit );
+ default: $errmsg = $this->_error( 'math_unknown_error', $errbit );
}
}
- $this->hash = substr ($contents, 1, 32);
+ if ( !$errmsg ) {
+ $this->hash = substr ($contents, 1, 32);
+ }
+
+ $res = wfRunHooks( 'MathAfterTexvc', array( &$this, &$errmsg ) );
+
+ if ( $errmsg ) {
+ return $errmsg;
+ }
+
if (!preg_match("/^[a-f0-9]{32}$/", $this->hash)) {
return $this->_error( 'math_unknown_error' );
}