Commit graph

424 commits

Author SHA1 Message Date
Umherirrender 0cefcd5d77 tests: Mock LoggerInterface to expect that a warning is thrown
Expecting E_ERROR and E_USER_ERROR is deprecated and will no longer be
possible in PHPUnit 10.

Bug: T342110
Change-Id: I713460ef62f1dbdf1332916965e833e7f9074e3c
2024-02-24 20:16:31 +01:00
Derick Alangi bc193d41a7
PreferencesIntegrationTest: CA will fail on null User objects
`$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
2024-02-19 13:21:40 +03:00
libraryupgrader f382be8562 build: Updating npm dependencies
npm:
* eslint-config-wikimedia: 0.25.1 → 0.26.0
* grunt-banana-checker: 0.11.0 → 0.11.1
* wdio-mediawiki: 2.1.0 → 2.5.0
* get-func-name: 2.0.0 → 2.0.2
  * https://github.com/advisories/GHSA-4q6p-r6v2-jvc5
* postcss: 8.4.30 → 8.4.35
  * https://github.com/advisories/GHSA-7fh5-64p2-3v2j

Change-Id: I5b01fa01c11a57a180b50bf2f8b3275e69d75f1c
2024-02-13 20:44:49 +00:00
Moritz Schubotz (physikerwelt) 8b481b45f1
Fix purging of cache in native mode
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
2024-02-05 20:56:19 +01:00
Moritz Schubotz (physikerwelt) f5b83c720c
Pass font options in underOver
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
2024-01-29 17:11:10 +01:00
Moritz Schubotz (physikerwelt) d270a9aa80
Pass font options in accents
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
2024-01-27 18:12:03 +01:00
Moritz Schubotz (physikerwelt) 57dbaeda39
Add over_operators group
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
2024-01-24 16:49:29 +01:00
ni1313 fbe057dc55 Add test for \overarc
Manually add test for \overarc to TexUtil-Ref.json

Bug: T354057
Change-Id: I249c89f9f7a2f336268393f61d428fbc09ee82f2
2024-01-17 16:29:36 +00:00
Moritz Schubotz (physikerwelt) 9236575a1a Remove explicit DB access
* 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
2024-01-11 15:57:02 +00:00
jenkins-bot 3a2011c3b7 Merge "Fix missing argument passing in DQ and FQ" 2024-01-06 21:43:41 +00:00
jenkins-bot 6ca717d31d Merge "Improve operator recognition heuristic" 2024-01-06 21:24:06 +00:00
Umherirrender b97ef597e0 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I8fad94b215664fb77acf8cd8140232271d2c2837
2024-01-06 16:30:26 +01:00
Moritz Schubotz (physikerwelt) a512710cf0
Improve operator recognition heuristic
In TeX display math mode \sum_a^b is rendered as
munderover, however \alpha_a^b is redndered as
msubsup.

This changes improves the heuristics to differentiate
between munderover operators such as sum prod and
other macros such as alpha, beta ...

Bug: T352697
Change-Id: I5a993e379791edeb3623171265e5be2651ee1359
2024-01-03 00:17:47 +01:00
Moritz Schubotz (physikerwelt) d25acea9c7
Fix missing argument passing in DQ and FQ
When rendering subscripts font arguments such as upright
font were not passed to the child nodes.

This changes passes the parameters.

Bug: T353340
Change-Id: I487bb01afa0d64c809affc4b8a466337d71a1c76
2024-01-02 20:36:49 +01:00
Stegmujo 4b30c9701a Add Intent to WikiTexVC
* make intent annotations possible in TeX math items
* introduce a new command to annotate as well as node and translation
* Adds a parser expression grammar to validate intent attributes for
* it basically adds the previous, now abandoned changeset: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Math/+/949964

Bug: T327098

Change-Id: I21adfac4c3580e238f059721fdf0c1566cb4e857
2023-12-21 14:28:18 +00:00
Stegmujo c27bc62ee7
Add export function for RTED
* for evaluation
* formats to bracket format as used in RTED java application

Change-Id: Ia85b7fdac55a9acfbc48e266a189e733634752f9
2023-12-07 17:27:19 +01:00
Stegmujo 3d0dfe1e43
Fix mathcal in chrome
* map to unicode chars

Bug: T352536
Change-Id: Iab04043df5cc04484d348b0c896a50c94ef79c16
2023-12-01 21:08:31 +01:00
Stegmujo 001e11bd7a
Fix double-struck letters in chrome
* map to literals to corresponding unicode characters when a double-struck state is recognized

Bug: T352196
Change-Id: I9b9e1d87c10858789751cd14f23d2feea3b928dd
2023-12-01 15:16:41 +01:00
Stegmujo c8fe00bd59
Fix closing bracket size too big
* fixes a glitch that attributes are not merged in closing tags

Bug: T351907
Change-Id: I1cc52c7726b12e12aea6cb56849721ae14229245
2023-11-30 15:58:22 +01:00
Stegmujo 79a2bf7e9f
Activate all FullCoverage Tests
Bug: T327392
Change-Id: I3af0c3c3aec83b8e0666318bdacbc1b639f8cd99
2023-11-30 12:21:50 +01:00
Stegmujo 3f5ba225ed Fix issue with nolimits
* nolimits is now also translated

Bug: T351850
Change-Id: I57d4bb4db117be667a5104876bfbd84a72e6bc34
2023-11-30 09:21:10 +00:00
Stegmujo a82727f61f
Rename TexVC in PHP to WikiTexVC
Change-Id: Idd98205ea291640b01946374f15c807da7fc26e5
2023-11-24 16:41:30 +01:00
Stegmujo 9abb258422
Fix genFrac bracket sizes
* genFrac renderMML function with bracket can produce false stretching
  on Chrome
* fixed for the cases with brackets (dbinom, tbinom, binom)

Bug: T350735
Change-Id: I0939de86963fa9c226346ce15e7edf7fc4e83c68
2023-11-20 16:32:44 +01:00
Stegmujo a4c3a365af Make distinction of bracket sizes
* \bigl( \Bigl( \biggl( \Biggl(

Bug: T350738
Change-Id: I557e6ff78255d0de28df1d6f6b6e78b76f9d8388
2023-11-17 15:54:10 +00:00
Stegmujo 7b03a170db
Fix liminf and limsup spacing
* and injlim projlim spacing

Bug: T350491
Change-Id: I7e4491fbdd461a4583f5418ba1924c647bb2df94
2023-11-03 18:37:27 +01:00
Stegmujo ac1d7a9a7b
Fix calls to trim null
Bug: T348936
Change-Id: I6e3fca041fb81975b175977b9a18d69fbf58620b
2023-11-03 17:02:22 +01:00
jenkins-bot 606f4347d1 Merge "Append invisible apply character" 2023-10-31 19:22:01 +00:00
Stegmujo 2c81f052c7
Append invisible apply character
* to named functions and named operators
* You can consider using that invisible apply character (U+2061) after other function names with known arguments (such as \sin, \cos...). Some accessibility tools take advantage of it, I am told, but it may also be used to provide correct spacing from the MathML operator dictionary. In Chrome <mi>sin</mi><mi>a</mi> will show up with no added spacing as sina, which is not ideal.

* namedFct with any succeeding macros/characters have an apply function

Bug : T350021

Change-Id: I7ee5fdd580fb018bc108a32500c17914dd5dc05f
2023-10-31 16:33:15 +01:00
jenkins-bot 83835f19e7 Merge "Add a possibility for creating a test wikipage for chemical formulas" 2023-10-30 16:22:48 +00:00
Moritz Schubotz (physikerwelt) bd474256a6 Remove functional dead code about PNG images
* PNG images are no longer displayed as of
  I595926027433182cc0396570bc3f1ce0cd2cafb3
* Remove functional dead code about PNG images
* Replace some type hints with type delcarations

Bug: T311620
Change-Id: I283c23e327ef908cfb4c827599fdcdb16252b08c
2023-10-30 10:46:08 +00:00
jenkins-bot 9ba97826f4 Merge "Fix incorrect child count of some element" 2023-10-27 14:00:30 +00:00
Stegmujo 9e9ba0241a Fix incorrect child count of some element
- munder: if only one child munder is not added as wrapping mml tag
- msup: renders an empty mi if there is no content for the superscript

This prevents some warnings in firefox browser dev-console.

Bug: T349825
Change-Id: Ia5efc1f33e3368e71527153d56160eee4ba3a46d
2023-10-27 13:17:55 +00:00
jenkins-bot 413b21d3be Merge "Remove too many rows in smallmatrix" 2023-10-27 10:53:49 +00:00
Stegmujo a53a5d58c8
Remove too many rows in smallmatrix
* From Feedback: The {smallmatrix} example has its fences wrapped in too many mrows I think, so it renders without stretching them in both Firefox and Chrome. Ideally you should be able to emit the <mo>(</mo> followed directly by an <mtable>, and trailed by <mo>)</mo>, and only wrap those 3 into a parent <mrow>.
* removes mrows and adds OPEN / CLOSE attributes
* tests MMLFullcoverage 194 to ~196 which cover the bigXYZ macros look
  ok

Bug: T348971
Change-Id: Ie444e5bb3e3f87fac915d2692b69e976d721582e
2023-10-27 11:19:06 +02:00
Stegmujo 8112c65a5d
Remove mstyle around spacing elements
* From Feedback: There is a curious use of <mstyle> around spacing elements, as in <mstyle scriptlevel="0"><mspace width="-0.167em"></mspace></mstyle>. I am not sure that wrapper element is needed? The mspace ought to be successful standalone.
* this is in the 'bmod' case

Bug: T349822
Change-Id: I9229ad73891d5000679761d3d4b2028d4a51ddf1
2023-10-27 10:35:59 +02:00
jenkins-bot 30c156a0a8 Merge "Make dataProvider in EnWikiFormulaeTest static" 2023-10-22 13:24:30 +00:00
jenkins-bot 9706ed33ba Merge "Make dataProvider in PopupTest static" 2023-10-22 05:02:42 +00:00
Moritz Schubotz (physikerwelt) de2913d960
Make dataProvider in EnWikiFormulaeTest static
Bug: T337160
Change-Id: I71205d564a3063e834a3cd0fc0075a3a6b7a19d2
2023-10-22 06:59:38 +02:00
Moritz Schubotz (physikerwelt) 7965a91ae5 Make dataProvider in PopupTest static
Bug: T337160
Change-Id: I1c5384d319d9e34397ed4d94b4d9888d46722b91
2023-10-21 21:06:06 +00:00
Moritz Schubotz (physikerwelt) 70ea8e0c88 Make dataProvider in MathWikibaseConnectorTest static
Bug: T337160
Change-Id: Idf24afec194b3bdf01dfcde0b9cac48faae2bb4d
2023-10-21 21:05:42 +00:00
Stegmujo 4750c45e06 Add a possibility for creating a test wikipage for chemical formulas
Bug: T329620
Change-Id: I5ca17dceb53bbf8ff148922088b2ba235d69e09a
2023-10-19 17:28:13 +00:00
Stegmujo 24bcd11e5b Fix ce statements and displaystyle for chem rendering on wikipages
* rollback some previous changes for ce env in Parserhookhandler
* some minor fixes for feedback in previous commit
* set tex mode for mhchem preprocessor, since MediaWiki Hooks add
  explicit ce tags: i.e. frormula coming to TexVC look like
  "{\displaystyle \ce{ C6H5-CHO }}"

Bug: T348975
Change-Id: Id06852b030f9ea77f016289d4f9e2258d5a9f0d4
2023-10-17 14:37:25 +00:00
Stegmujo 9360ca94c4
Fix table alignment to left
* currently, \begin{align} generates <mtable columnalign="right" but it should be <mtable columnalign="left"

Bug: T348791
Change-Id: Ic0df45aba4fdb6ffbdc790b5e4bc56e7daeca802
2023-10-13 15:08:34 +02:00
Stegmujo 1aae7cde53
Deactivate stretchy attribute in left and right
Bug: T348793
Change-Id: I5c7c1fd02c4fb42eb8478b744fea3dd06463401e
2023-10-13 13:58:57 +02:00
Stegmujo 00f47e8866 Fix issues in MMLmhchemTest with braces and macro longrightleftharpoons
* updating the braces since mkern, mskip etc are Fun1 functions in TexVC
* updating TexVC support flag in test
* added macro longrightleftharpoons to rendered cases
* nearly all tests render correct in HTML now

Bug: T329620
Change-Id: I78da466c88d41f794e81f7222c9a67c3f4d482d2
2023-10-12 15:55:43 +00:00
Stegmujo b26a8805c1
Add rendering to MathmL visual results to MathMLTest
* fix maintenance script in parametrization for generating correct
  reference MathML
* update MathML references for MMLmhchemTest
* and update the reference formulas, which not display MathML correctly
* tests which have math enviroment switch (which is currently not defined) are currently skipped

Bug: T329620
Change-Id: I09f2c393880daa8fef3e2763821df59048c3c98c
2023-10-12 14:36:57 +02:00
Stegmujo 846edd1611 Add intbar and intBar to MathML rendering
* added some tests
* removing intbar from skipped tests in MMLGenTexUtilTest

Bug: T348318
Bug: T137787
Change-Id: If0dd9beb36d52bc5305fdb66438f1ad2ca092aaf
2023-10-10 10:19:45 +00:00
Moritz Schubotz (physikerwelt) 272f39ca2d
Fix integral command namings
* Remove \strokeint which was probably a typo and should be \strokedint
* Add \intBar command

Not done:
* Implement rendering of \intBar and \intbar, it would make sense to wait for
the mathoid reference rending here, which is just around the corner

Bug: T137787
Bug: T348373
Change-Id: I19d24fc23f59dda87c7c39a265f17efddb9fee8f
2023-10-09 15:02:46 +02:00
Stegmujo f4c91856bc
Refine skipped indices in MMLGenerationTexUtilTest
* adapts skipped indices to represent all supported cmds and macros

Bug: T340024
Change-Id: Ib01f02c3b73dac80ee9878c22549740d728bdf57
2023-10-06 14:02:43 +02:00
jenkins-bot d5c48b8260 Merge "Render MathML for atop and choose" 2023-10-05 16:20:25 +00:00