Page MenuHomePhabricator

Implicitly generate Math elements in MathML from the TexVC parsetree
Closed, ResolvedPublic

Description

Currently TexVC creates a parsetrree without math and semantics elemntents.

Add these so native renderer interface can be used properly.
Remove the previous way of generating Math element with Utility function from the tests.

Event Timeline

Change 893788 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[mediawiki/extensions/Math@master] Add minimal native MML mode

https://gerrit.wikimedia.org/r/893788

To test the new rendering mode, one has to add the following line to LocalSettings

$wgMathValidModes[] =  'native';

thereafter one can select the native MathML mode

Screenshot 2023-03-02 at 20-15-50 Preferences - test.png (326×756 px, 52 KB)

and it uses the new rendering
Screenshot 2023-03-02 at 20.19.30.png (1×1 px, 461 KB)

When one adds https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Math/+/893818, one can see the current progress, for example, when looking at the Fourier transform page.

Screenshot 2023-03-02 at 22-22-07 Fourier - test.png (2×3 px, 947 KB)

The root cause of the Error is

Error: Call to undefined method MediaWiki\Extension\Math\TexVC\Nodes\DQ::getArg()

I suggest adding types to the respective methods so that phan can spot these errors. Moreover, I would rather avoid using function names as arguments, as this creates in particular several empty arguments.