Commit graph

2553 commits

Author SHA1 Message Date
Stegmujo d3da9f2ce1
Add updated TexConstants and Lengths
* mostly this solves dependency references

Bug: T302628
Change-Id: Idee807304e283def14ea0eb00762793a8e52ae7e
2022-12-23 11:06:34 +01:00
Translation updater bot 4366d27660 Localisation updates from https://translatewiki.net.
Change-Id: I87bb201f6c5a1bd50e3cf3fab504414170372d86
2022-12-23 09:07:12 +01:00
jenkins-bot 3c6ad74002 Merge "Add MML nodes and basic constants for MML generation" 2022-12-21 12:48:24 +00:00
Stegmujo 34b98c5a0d
Add MML nodes and basic constants for MML generation
Bug: T302628

Change-Id: If18a5650b6c92b5da7496dd891987ecc8bd0efab
2022-12-21 12:05:26 +01:00
Translation updater bot 461f091ba4 Localisation updates from https://translatewiki.net.
Change-Id: I71676a95fdcf1d5d8452e64cb91a585cee8ca71d
2022-12-21 09:16:31 +01:00
Translation updater bot a0d76af357 Localisation updates from https://translatewiki.net.
Change-Id: I295becac9e52eeb4976077d8c0611fd0d2aad01e
2022-12-19 09:04:15 +01:00
Translation updater bot fae5de04cd Localisation updates from https://translatewiki.net.
Change-Id: Iaa53270625f2b0beef730a8038d76d745d905a84
2022-12-15 11:36:19 +01:00
Jon Robson 571e624c4e Load Math ResourceLoader modules on mobile
The default for a module is desktop and all of these modules
at a glance look like they should be loaded on mobile as
well.

Bug: T324723
Change-Id: I606b75d6524692e4183cd71a991140976d04d23f
2022-12-13 16:47:31 +00:00
Translation updater bot 288950de43 Localisation updates from https://translatewiki.net.
Change-Id: I147be91efd69c70cd237c0c9978b92f469ab364f
2022-12-12 08:22:39 +01:00
Umherirrender 6e424c2e4a Replace comment about deprecated Http::post
Bug: T305813
Change-Id: I1975fd473c8d57ab7e43a47ea4da3d4f33fac68c
2022-12-11 15:04:59 +01:00
Translation updater bot c3c610fa22 Localisation updates from https://translatewiki.net.
Change-Id: Iddb83d20b6fe17de5604ad310de97bd2fd4d85c8
2022-12-08 08:29:23 +01:00
Translation updater bot a923a6f0a5 Localisation updates from https://translatewiki.net.
Change-Id: I41be79c8aed7fb1aeaa72718b03de320933fe7d1
2022-12-07 08:13:33 +01:00
jenkins-bot 104c80198c Merge "Update positive regression tests" 2022-12-06 10:50:18 +00:00
Moritz Schubotz (physikerwelt) cbd67195f5
Update positive regression tests
Adapt test running structure to the new structure for good tests
coming from texvcjs.

Change-Id: I330bb3f8f0c6f379d624986827f96946af1d4c12
2022-12-06 10:59:39 +01:00
AndreG-P 95c5757ee5 Enable popups for annotated math formulae
Enable popup extension for annotated math expressions. The popup shows a short summary of the formula and is generated via the Popup API introduced with I65fcbf25ac5818f6c649daf494c719921247e8f5. It is a follow up of Iefe98c1f0422dbf034e385b1a41a859d030a2cf4.

Bug: T208758
Change-Id: I8c45b7e441083c240bbf2e0217ec219df7dcc351
2022-12-06 06:07:22 +00:00
Translation updater bot 7a0a47c075 Localisation updates from https://translatewiki.net.
Change-Id: I41c3149a07dca229160375f6b78ce41037bf738d
2022-12-05 08:33:56 +01:00
jenkins-bot 7c58d11125 Merge "Fix broken/incomplete regex patterns in TexNode::texContainsFunc" 2022-12-01 20:53:02 +00:00
jenkins-bot ed47beba1b Merge "Minor preformance improvement in TexNode::texContainsFunc" 2022-12-01 20:50:54 +00:00
thiemowmde 566944c42d Fix broken/incomplete regex patterns in TexNode::texContainsFunc
I compared with
6c6988c4f6/lib/astutil.js
and found two mistakes:
* Missing space at the end of the color regex.
* Not enough backslash escaping in the last regex.

Note how the code in lines #116 and #130 is now identical.

Change-Id: I13b75ad4a1e4da0766c0d73b8786b21865945697
2022-12-01 17:05:30 +01:00
thiemowmde f09ce3134b Add many more testcases for TexNode::texContainsFunc()
Positive as well as negative tests. This patch intentionally doesn't
touch the implementation but simply documents how the code currently
behaves.

Change-Id: Ib670ad680087e520f4a99e932e5a2a9fd2d115de
2022-12-01 16:57:28 +01:00
thiemowmde f459b0b305 Rewrite TexNodeTest to use @dataProviders
Personally I find this easier to read. It allows to maintain a compact
list of input values with the expected output.

Change-Id: Ifeb532e2b94c674b512b3c40f101977939b83cd5
2022-12-01 16:34:40 +01:00
thiemowmde 89941febb4 Minor preformance improvement in TexNode::texContainsFunc
This apparently doesn't make that much of a difference, but should
still be worth it. Strings that don't start with a backslash can not
match anything. We can stop much earlier in this case.

Change-Id: I1efb8dc6807931a075f450c56f9bbd64980c879a
2022-12-01 16:15:22 +01:00
Translation updater bot af92f38bbf Localisation updates from https://translatewiki.net.
Change-Id: I90b526415b72aee4b79de4de1cb33a3db02116de
2022-12-01 08:16:02 +01:00
Translation updater bot 3a484f8baf Localisation updates from https://translatewiki.net.
Change-Id: I0df877192e6d2d8244fb897334f4c03ae2b0dd9b
2022-11-30 08:53:12 +01:00
jenkins-bot 99b1b231c5 Merge "Fix assert functions in En-MediaWiki-Testcase" 2022-11-29 20:12:52 +00:00
jenkins-bot 04c839d680 Merge "Skip tests that are known to fail" 2022-11-29 19:38:44 +00:00
Stegmujo d4418049c8
Fix assert functions in En-MediaWiki-Testcase
Change-Id: I9355d86e9a482fa2f86aac19a2018a6ad149ef20
2022-11-29 20:29:11 +01:00
thiemowmde f4ed725712 Fix and add test for "0" special case in TexNode
We fixed this in I47b6d5b but broke it again in Ie8d8106. Let's
finally add a test for this edge-case.

Change-Id: I9a43518f9edf0fab05e76bbb02a30fefd039b77d
2022-11-29 12:11:15 +01:00
jenkins-bot a58d9c39d3 Merge "Various code cleanups, more compact syntax and such" 2022-11-29 10:21:02 +00:00
jenkins-bot 4d3cb0dc69 Merge "Simplify VE data modules using 'packageFiles'" 2022-11-29 01:14:00 +00:00
jenkins-bot 3288979f2e Merge "Remove unnecessary uses of <span class="mw-headline">" 2022-11-28 18:45:29 +00:00
thiemowmde be25b18d8c Rewrite hot TexNode methods for performance
It appears like these methods are called hundreds of thousands of
times. This is mostly because they are recursive. According to my
benchmarks the changes proposed in this patch make a big difference.

Some notes:
* I try to avoid stepping deeper into the recursion whenever possible,
  i.e. do the recursion only when the current element is an array.
  This is relevant because the function call overhead is surpsiringly
  expensive in PHP.
* I tried to arrange the if-elseif-else branches in a way so that the
  most minimal code is executed while the code is still readable.

Change-Id: Ie8d8106390cac441cb93adcd48a937ba312a2d91
2022-11-28 12:13:41 +00:00
Translation updater bot d8279aa9cf Localisation updates from https://translatewiki.net.
Change-Id: I2317d0f772b82b85a38dbfe8bcd854d1ceba907b
2022-11-28 08:49:51 +01:00
jenkins-bot c7bfd4a695 Merge "Replace some confusing array_walk with more trivial foreach" 2022-11-27 14:59:43 +00:00
Moritz Schubotz (physikerwelt) 7ecce2a104
Skip tests that are known to fail
* don't return on skipped tests
* add some additional non math test cases

Change-Id: Ia389141693a2e2ed6dea4294549674402e109d64
2022-11-27 15:08:56 +01:00
Translation updater bot a1a5457473 Localisation updates from https://translatewiki.net.
Change-Id: I1c6c148c6359b7320d7a4ea7079c11d012a0b205
2022-11-25 08:26:16 +01:00
Bartosz Dziewoński 94a48c1f1b Remove unnecessary uses of <span class="mw-headline">
Bug: T323773
Change-Id: Ia9528a30174daaca3d557081ec5191e626056a9d
2022-11-24 17:04:29 +01:00
Translation updater bot f28d135be4 Localisation updates from https://translatewiki.net.
Change-Id: I623e3d87299477e5adae5fb34dd4f842dfecd899
2022-11-24 08:17:44 +01:00
jenkins-bot 21ee1d43aa Merge "Make code using the Math.CheckerFactory service discoverable" 2022-11-23 14:57:00 +00:00
Thiemo Kreuz 7dbc300a5f Various code cleanups, more compact syntax and such
Some notes:
* Note that array_column() strips array keys. I checked and this is
  fine here.
* Html::element() will skip attributes that are set to null or false.
  Perfect fit here.
* I routinely remove comments that do notjing but repeat what the
  code already says.

Change-Id: Ie7797b78f1af5d8404c9e97b333fac8c6b3ac85e
2022-11-23 15:36:22 +01:00
Moritz Schubotz (physikerwelt) b3e57cbfc2 Make code using the Math.CheckerFactory service discoverable
Otherwise IDEs and other tools don't know what's going on.
...->getService() returns mixed.

Change-Id: If0429485941c19eb0e88896cb1ada66a5320bafe
2022-11-23 12:10:32 +00:00
thiemowmde 9b32ed8eb6 Replace manual array merge in ParserUtil with native function
Note: I'm not sure if this code is copied from somewhere else. If it
is this change is better done in the source.

Change-Id: Ic84be9b8b52a190eb5a41f2c7ff8fd6c04724318
2022-11-23 10:56:33 +00:00
thiemowmde 14647fa3b1 Fix Phan warning in TexVC class
Required-For: If0429485941c19eb0e88896cb1ada66a5320bafe
Change-Id: I77f4d552b63b7ed935502e2d45cfa97e5310927c
2022-11-23 11:04:10 +01:00
thiemowmde a5668bd0a7 Replace some confusing array_walk with more trivial foreach
Personally I find them confusing because there is apparently no way
to "stop" an array_walk(), and that's why it constantly needs to
check if it even needs to run. Why not use a syntax we can actually
stop? I find this more readable and it makes the code actually run
faster. On average 50% of the iterations get skipped now.

Change-Id: I47b6d5b8f4ad5c9d0f47b389c638196e734809bb
2022-11-23 09:16:52 +00:00
Translation updater bot bb39263f59 Localisation updates from https://translatewiki.net.
Change-Id: Ib5ebef4eda6a0a55daa7a0f3b69aa5d456416fe5
2022-11-23 08:32:54 +01:00
jenkins-bot e0f6e21ac7 Merge "Remove PNG rendering mode" 2022-11-22 19:07:20 +00:00
Bartosz Dziewoński 9207931f53 Simplify VE data modules using 'packageFiles'
We can now serve the JSON data almost directly (although, curiously,
we need a main file in the module that is JavaScript, not JSON),
and without using global state in the JS code.

Change-Id: I203b3e396b28f4b4ef49c3c0918a4025082308c4
2022-11-22 18:43:04 +01:00
jenkins-bot e3d54827cf Merge "Make use of ?: and ?? shortcut syntax where it makes sense" 2022-11-22 12:19:30 +00:00
thiemowmde 67906845ff Make use of ?: and ?? shortcut syntax where it makes sense
I hope this makes the code more readable.

Change-Id: Ie458551d26cd8c8cd6e1cc18789d93176230f0d4
2022-11-22 12:29:44 +01:00
Stegmujo 1b241d4aeb Change validate in MathValidator to php-based checking
Bug: T323554
Change-Id: I8e900e03794bf4eda0ff27381c2c8078234a0b2d
2022-11-22 11:17:20 +00:00