In LaTeX line breaks in matrix elements
have an optional argument that controls
the vertical spacing between the current
and the next line. For example,
{\begin{aligned}a\\[6pt] b\end{aligned}}
generates a 6pt space.
This was never implemented and ignored by
mathoid.
The native MathML implementation is unaware
of the optional argument and just prints it
to the next line.
* This commit ignores the input on the grammar
side.
Bug: T375295
Change-Id: I08996129beca9ad852d23f28d7136c982707aea1
As indicated in the comment the code intents
to add "additional italic mathvariant
when bold already". However, effectively it
always added an additional -italic when
any mathvariant was given.
* Only add '-italic' if mathvariant is 'bold'
Bug: T375244
Change-Id: Iafb375753a98ff41c3d076819288345a9e2efb0c
* Add native to default valid modes.
* Remove old Mathoid mode from the default valid modes.
* Set native as the default choice, replacing Mathoid.
* Adjust fallback mechanism.
Bug: T373705
Change-Id: Ie6412623577e3f954c1302417d1b1b667f88863e
Instead of manually crafted $this->testCase properties.
Also make use of the dedicated PHPUnit feature to mark as test as
passed. While assertTrue( true ) is a very common hack it can be
confusing.
Change-Id: Ic071bf561929c2a79537111bee18631865f91366
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation and to remove the exclusion of the
sniff.
The activated sniff avoids that new code is missing doc-typehints or
real-typehints.
Change-Id: Id7fcfd086cdbb3f040091e1d1a81472e7a524091
Update test to find MathML element instead of image.
This is required since the default in labs in now MathML.
Bug: T372872
Change-Id: I4e9500effaca9cef704f06ec003a0e01bdcfb3f1
Just removing unused code that never did anything. Note this is only
in a test. As long as all tests still succeed this can't really cause
any problems, I believe.
Change-Id: I272803353eed9de0ecf98c55b75710df16da2c44
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: Ifcc9113bc1d2cf79d21871abe7652d7ed8dde20a
In MathML outer table boarders are represented with the
notation attribute of an menclose element. The inner
boarders are represented by the rowlines attribute
of the mtable element. The rowline element accepts
a space seperated list of row boarders. In LaTeX
the bottom line is represented by a new matrix row
that only contains \hline.
This change discover \hline elements in matrix cells
and then determines if it is in the first or last line.
When it is in the last line, the line is removed to avoid
an empty <mtr /> in the output.
Bug: T366417
Change-Id: I196e0d14a183a63696363f9e3006cf65571dc56c
Originally the parse tree was a binary tree, from that
time matrix element were put into that data structure.
This was partially undone, but not full which leads to some artifacts
in matrix cells.
One of the problem is that due to the binary parse
tree structure the postprocessing did not correctly
identfy \limits.
This change changes reduces nesting from matrix, and regards
matrix instances as two-dimensional TexArrays.
Bug: T362344
Change-Id: I66a31a09f204709a51d6b5c9ecefc083f7ee2d6d
TexArray is an array of tex nodes. To improve
readability and type hinting we make TexArray
iterable.
Change-Id: I5b9b2ca63400400bc399c08445ff911f8e20a0d1
When collecting user feedback regarding the native
rendering option on the German Wikipedia (T346795)
it became apparent that some power users aim for bigger
and bolder fonts and a more LaTeX-like layout.
MathML, however, aims to format math as an integral part
of the text with uniform fonts and spacing.
To match both user needs, this patch adds a new rendering
option that uses client-side MathJax (without a need for
restbase or mathoid).
* Adjust MathJax`s loader to be compatible with the mw loader
* Add new rendering mode
* Copy MathJax source to resource module as foreign repo
Bug: T354136
Change-Id: I1ecf9c77fefc3b0f717107d81979276023f6cb84
To reduce the complexity of the parse tree we remove the curly
element which is used for grouping in TeX. Instead, we use
use an attribute which defines if the group is put into curly
brackets or not. The functionality of the curly element
is transferred to the TexArray which was the only possible
child of the curly element before. To ease the transition,
we add a special constructor to TexArray.
We could not measure any performance implications of this change.
Bug: T333973
Change-Id: Idcb58694022831113bdc437576bb9f48658fff2f
The LaTeXML reference variant seems to be generated
with a slightly different version than before
Bug: T354057
Change-Id: I3d51dc06664120a1c7f9a933d7328210b7c6817f
While investigating the dependency between
Math and Wikibase, it turned out there was
a hard dependency in the test code.
This change makes the availability of the Wikibase
Extension optional and conditionally skips tests.
Bug: T362027
Change-Id: I9401d7d4a3277b6923dcd81f411ac5a08f1242d2
Excluded Generic.WhiteSpace.ScopeIndent as
it impact many lines in switch/case syntax
Also disable BraceNotOnOwnLine due to T347440
Change-Id: Ia0c8072da9b7bff6a4010d3fb70cb0e576cdf98a
Expecting E_ERROR and E_USER_ERROR is deprecated and will no longer be
possible in PHPUnit 10.
Bug: T342110
Change-Id: I713460ef62f1dbdf1332916965e833e7f9074e3c
`$this->createMock( User::class )` will return a mock User object
with all fields defaulting to null and this will fail when the
`onGetPreferences()` hook fires in CA since that gets consumed by
`getFormDescriptor()` in PreferencesFactory.
This patch changes the mock user object to a test user object and
this is fine because it's already an integration test.
Bug: T357854
Change-Id: I3d80fc1e59ff00a1a08def41c53d82bc093b6e00
Adding action=purge to the url did not bypass cache
in native mode, because the check request was performed
before the purge information was passed.
* Move purge property to the base class
* Pass purge option via the checker constructor
* Add cache checking for mathoid checker
* Adjust method signatures accordingly
Change-Id: I6f545060ae72dac8b12fb0f85662c4048059b2e9
Following the same argument as for accents,
font options should also be passed in underOver
constructs.
* Pass options
* Add test
* In I6924d712db6852f99d7896b1f11cfbd22851d757
curly learned to encapsulate its output in a
mrow. Thus, the if-clause is no longer needed.
Bug: T352609
Change-Id: I6dd3303d9b5ef9ae32ad33c91a4cc1bbdad46109
Accents such as \widetilde did not pass
their font options to their child element.
* Pass options
* Add test
* In I6924d712db6852f99d7896b1f11cfbd22851d757
curly learned to encapsulate its output in a
mrow. Thus, the if-clause is no longer needed.
Bug: T352609
Change-Id: I81ecda09d017c73a4593ae36c630426229c7559f
instead of testing if an operator starts
with the letter \o we keep an explicit
dictonary of operators which should
be rendered using mover instead of
msub.
Bug: T352699
Change-Id: I916acf2f71d747a31a882fecfccac832436ea991
* Uses BagOfStuff caching instead of custom-made DB cache
* By configuring the BagOfStuff cache in a way that
it writes to the database no performance implications are expected
* For WMF-use this should have no effect since restbase
is used to cache stuff
* Replaces Ib2c216f54e6817ee2c3be0355ba72bd4769ba6ea
Bug: T349442
Change-Id: I1ce8ad9cf4c1a9ae71f447e4e067b39ee2601640