diff --git a/Math.body.php b/Math.body.php index af0b6e0..6494637 100644 --- a/Math.body.php +++ b/Math.body.php @@ -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() ); diff --git a/mathParserTests.txt b/mathParserTests.txt index 51691d4..5580c81 100644 --- a/mathParserTests.txt +++ b/mathParserTests.txt @@ -165,3 +165,18 @@ BUG 31442: Math accents with math font fail to parse if braces not used

\tilde \mathcal{M}

!! end + +!! test +BUG 31824: Empty math tag returns uniq +!! input + +!! result +!! end + +!! test +BUG 31824: Empty math tag returns uniq +!! input + +!! result +!! end +