Skip to content

Conversation

@codinglist
Copy link

add semantics tag name

@coveralls
Copy link

Coverage Status

coverage: 99.635% (-0.4%) from 100.0%
when pulling f36ec5c on codinglist:master
into c3ecbf3 on PHPOffice:master.

@Progi1984
Copy link
Member

@codinglist Hi have you a MathML sample ?

@codinglist
Copy link
Author

codinglist commented May 26, 2025

@codinglist Hi have you a MathML sample ?

codes:

use PhpOffice\Math\Element;
use PhpOffice\Math\Math;
use PhpOffice\Math\Writer\MathML;

include_once './vendor/autoload.php';
$math = new Math();

$semantics = new Element\Semantics();
$semantics->add(new Element\Identifier('y'));
$semantics->addAnnotation('application/x-tex', ' y ');

$math->add($semantics);

$writer = new MathML();
$writer->write($math);

error:

Fatal error: Uncaught PhpOffice\Math\Exception\NotImplementedException: PhpOffice\Math\Writer\MathML::getElementTagName : The element of the class PhpOffice\Math\Element\Semantics has no tag name in /xproject/vendor/phpoffice/math/src/Math/Writer/MathML.php:128 Stack trace: #0 / /xproject/vendor/phpoffice/math/src/Math/Writer/MathML.php(41): PhpOffice\Math\Writer\MathML->getElementTagName(Object(PhpOffice\Math\Element\Semantics)) #1 /xproject/vendor/phpoffice/math/src/Math/Writer/MathML.php(30): PhpOffice\Math\Writer\MathML->writeElementItem(Object(PhpOffice\Math\Element\Semantics)) #2 /xproject/test.php(16): PhpOffice\Math\Writer\MathML->write(Object(PhpOffice\Math\Math)) #3 {main} thrown in /xproject/src/Math/Writer/MathML.php on line 128

@Progi1984
Copy link
Member

Hi. Thank you for your code.

I created a new PR #20 : I used your code and added you to the changelog as contributor.

@Progi1984 Progi1984 closed this May 27, 2025
@Progi1984 Progi1984 added this to the 0.3.0 milestone May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants