diff --git a/MathRenderer.php b/MathRenderer.php index 58a317a..8e46583 100644 --- a/MathRenderer.php +++ b/MathRenderer.php @@ -76,6 +76,9 @@ abstract class MathRenderer { $this->userInputTex = $tex; $this->tex = $tex; $this->params = $params; + if ( isset( $params['id'] ) ) { + $this->id = $params['id']; + } } /** @@ -139,10 +142,7 @@ abstract class MathRenderer { $tex = '{\textstyle ' . $tex . '}'; } } - $id = null; - if ( isset( $params['id'] ) ) { - $id = $params['id']; - } + if ( isset( $params['forcemathmode'] ) ) { $mode = $params['forcemathmode']; } diff --git a/tests/MathIdTest.php b/tests/MathIdTest.php new file mode 100644 index 0000000..c7c5719 --- /dev/null +++ b/tests/MathIdTest.php @@ -0,0 +1,17 @@ + RANDOM_ID ) ); + $this->assertEquals( RANDOM_ID, $renderer->getId() ); + } + +} \ No newline at end of file