Bug 31824: Fix for the empty math tag

It fixes the bug by returning an empty string if the math tag is
empty.

Parser tests and changes so that white-text only works.

Change-Id: Ica0dbb9bcfc709331e348fb11d24673103be3b37
This commit is contained in:
Suhas 2012-04-06 11:20:54 -04:00 committed by Mark A. Hershberger
parent c005843d62
commit e5e574604b
2 changed files with 19 additions and 0 deletions

View File

@ -382,6 +382,10 @@ class MathRenderer {
}
public static function renderMath( $tex, $params = array(), ParserOptions $parserOptions = null ) {
if( trim( $tex ) == "" ) {
return "";
}
$math = new MathRenderer( $tex, $params );
if ( $parserOptions ) {
$math->setOutputMode( $parserOptions->getMath() );

View File

@ -165,3 +165,18 @@ BUG 31442: Math accents with math font fail to parse if braces not used
<p><img class="tex" alt="\tilde \mathcal{M}" src="/images/math/5/5/0/55072ce6ef8c840c4b7687bd8a028bde.png" />
</p>
!! end
!! test
BUG 31824: Empty math tag returns uniq
!! input
<math></math>
!! result
!! end
!! test
BUG 31824: Empty math tag returns uniq
!! input
<math> </math>
!! result
!! end