Commit graph

281 commits

Author SHA1 Message Date
Stegmujo 78b7769149
Fix parsing macros in mbox for TexUtilTest
* testindices 638 to 654 and 13

Bug: T327392

Change-Id: I1c83290f50f3fe7ee7e512574150d6be9723b3e7
2023-02-13 13:59:34 +01:00
Stegmujo 39c400a431 Fix Parsing of Mod elements with and without params
* some adaptions to test and comparator
* minor fix in mappings for ncong
* introduce a LaTeXML Fallback for the tex-cases:
** "\ce{\ca}"
** "\mod"

Bug: T327392

Change-Id: Ie2efa392bd517a28fe8b6e8d0cecdba64cd1c415
2023-02-13 12:23:44 +00:00
Stegmujo dbf15a72c6 Fix parsing functions for MMLGenerationTexVCUtilTest
* for "oint","ointctrclockwise", "varointclockwise."
* some ignored attributes added to similarity algorithm

Bug: T327392
Change-Id: Id4cf720bb2d2c8aeb524c2303bdf0d4be3547404
2023-02-08 14:30:46 +00:00
jenkins-bot 347dcbd3fe Merge "Fix significant typo in grammar" 2023-01-03 16:02:27 +00:00
jenkins-bot 6153004078 Merge "Improve security of MathML output" 2023-01-03 15:28:24 +00:00
Moritz Schubotz (physikerwelt) 7b425a5500
Improve security of MathML output
Avoid that user input is passed to the HTML output directly by using
HTML methods for tag generation. This also enables additional phan checks.

Change-Id: Iff584ac829c190e413a36331c53d6835a86bc0d5
2023-01-03 15:47:54 +01:00
Moritz Schubotz (physikerwelt) 81fa5b0c97
Fix significant typo in grammar
* Uq and Dq was mixed
* Simplify regeneration of grammar for node developers
* Speed up npm test by ignoring local test json files

Change-Id: Iec273dcc967be46d3df52260fc56f1969667e497
2022-12-30 16:58:39 +01:00
Moritz Schubotz (physikerwelt) 96c636e243
Refactor LocalChecker
* Do not throw arbitrary exception in constructor
* Remove custom fields

Change-Id: Ibb49f6a5e66649bab8b605e8785a868b74dbd7d0
2022-12-29 22:51:34 +01:00
Moritz Schubotz (physikerwelt) b9e297c4ec Improve test coverage for nodes
* Use merror instead of plain strings for not implemented functions

Change-Id: If20559e05f3b0c8921a28c623102b8f4788a3c94
2022-12-28 19:18:21 +00:00
Moritz Schubotz (physikerwelt) 469c698e47
Improve checking performance
* Report only on used packages if requested

Change-Id: I5b4fc6d7e571206f5b5d41d3bf268251ed1a8677
2022-12-28 13:34:23 +01:00
Moritz Schubotz (physikerwelt) 70acbd7ea4
Fix missing curlies in chem nodes
* the php implementation had fewer curlies compared to the
  js implmenetation

* remove unused function name (could be replace get_class)

* Add testcase for declh

Change-Id: I8132604a659d7ddf98e1f73686b40ff0591229f3
2022-12-28 00:56:47 +01:00
Stegmujo 783797bb9a
Add test for basic MML Methods
Bug: T302628
Change-Id: Ib3d781a516e53392fb09a2c70b322805dcb43fcf
2022-12-23 22:46:59 +01:00
Stegmujo f8e25f5dce
Update visitor functions and add parsing methods (MMLGen)
Bug: T302628

Change-Id: I5374a831cf74a6eb3bf3165abe3ad0661ec07f5f
2022-12-23 20:02:00 +01:00
Stegmujo a692599224 Add mappings for MMLGen
Bug: T302628

Change-Id: I839b77d805820262bb96fea801f1f2c3f52b53d5
2022-12-23 15:29:33 +00:00
jenkins-bot 5db9b573f3 Merge "Update namespace references in MMLNodes" 2022-12-23 15:16:25 +00:00
Stegmujo bdcd599e97 Update namespace references in MMLNodes
* this is necessary for phan to have corresponding namespaces to project structure

Bug: T302628

Change-Id: Ic485136990698828c04739db48f69658264bfd25
2022-12-23 14:54:00 +00:00
Stegmujo c124f1ec26 Add utility classes for generating MathML
Bug: T302628

Change-Id: I90f0470a14f0adeaef94b90833b4bbc32a758a32
2022-12-23 14:42:18 +00:00
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
Stegmujo 34b98c5a0d
Add MML nodes and basic constants for MML generation
Bug: T302628

Change-Id: If18a5650b6c92b5da7496dd891987ecc8bd0efab
2022-12-21 12:05:26 +01:00
Umherirrender 6e424c2e4a Replace comment about deprecated Http::post
Bug: T305813
Change-Id: I1975fd473c8d57ab7e43a47ea4da3d4f33fac68c
2022-12-11 15:04:59 +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
jenkins-bot 7c58d11125 Merge "Fix broken/incomplete regex patterns in TexNode::texContainsFunc" 2022-12-01 20:53:02 +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 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
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
jenkins-bot c7bfd4a695 Merge "Replace some confusing array_walk with more trivial foreach" 2022-11-27 14:59:43 +00: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
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
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
Moritz Schubotz (physikerwelt) 110656335f Remove PNG rendering mode
Removes functionality to
* select PNG rendering mode
* automated fallback to PNG images for SVG rendering
* PNG mode related class and tests

However, PNG images received from mathoid / restbase are still stored.

Bug: T311620
Change-Id: I595926027433182cc0396570bc3f1ce0cd2cafb3
2022-11-21 18:57:27 +00:00
Stegmujo db40ad2ac3 Add Service Initialization in Render
Bug: T312528

Change-Id: I88db7691cf7ac0a66d130b5472b41355a6c4abc2
2022-11-21 11:40:43 +00:00
jenkins-bot 4b6137bed4 Merge "Avoid try…catch where if…else will do when using LanguageFactory" 2022-11-21 08:57:13 +00:00
Bartosz Dziewoński 1b7a46ff4f Avoid try…catch where if…else will do when using LanguageFactory
Needed for I869af06896b9757af18488b916211c5a41a8c563, where I am
trying to change LanguageFactory in MediaWiki core not to use
MWException.

I truly feel mocked after working with this code. See if you can find
the two lines in this diff where the meaningful changes are.

Change-Id: Ifcb31dbb7113ce57526f06558cde2abedee317d7
2022-11-18 21:08:24 +01:00
d.savuljesku ef32effe35 Fix calling array function on stdClass
Bug: T322634
Change-Id: I8c7c7004128da9de6f266ebca43b9aa78802a2de
2022-11-08 14:59:03 +01:00
jenkins-bot 3dcdbbd95b Merge "Fix Perfomance Issues of TexUtil" 2022-10-25 18:10:09 +00:00
jenkins-bot ded8f70772 Merge "Activate chem and inline-tex type input in LocalChecker" 2022-10-25 17:50:31 +00:00
Stegmujo b5d3bca4b4 Fix Perfomance Issues of TexUtil
TexUtil gets instanciated and loads a json for each node in Literal and Fun1. This is not necessary since it takes much RAM and time to load the corresponding JSON from files.

Bug: T321599

Change-Id: I91855ebc4437f075302ae13d367ca4902cc0f3ba
2022-10-25 17:44:02 +00:00
Stegmujo c74ced3716
Activate chem and inline-tex type input in LocalChecker
Bug: T321262

Change-Id: Ib8e55290cc77cdc07274e7f1dbd27d20db0f3227
2022-10-25 18:35:54 +02:00
Stegmujo 2d56f19e3c Fixing Parser for All Wiki and Chem Tests
This is required to run these tests.

Change-Id: I9e12b2f4cf6dc7d96cd51f408d8aa8d71b224ab3
2022-10-25 12:06:58 +00:00
Stegmujo c27f7edef9 Add Integration for the TexVC-PHP check to Math
Bug: T312528

Change-Id: I0eda7d4213a5f703ab7ae7887aa364af9e576dbe
2022-10-20 16:39:19 +00:00
Stegmujo ba47c32e1d
Add Node and Util fixes for Parser.php
For development history of this changeset see:
Id96a4b1b55e3959aab81f4ba436c5ac125f2a1bb

Bug: T312528

Change-Id: I61cfdbd63f8d50b072ada05927a134686fdd53d3
2022-10-19 16:33:15 +02:00
Stegmujo e091c77593 Add TexVC with Check functionality
Bug: T312528

Change-Id: Ib66a4603e3c1869d5c197b72b46b098d0df15e34
2022-10-18 17:57:19 +00:00
Stegmujo ad701733ec Add Grammar and Parser Functionalities
For development history of this changeset see:
Id96a4b1b55e3959aab81f4ba436c5ac125f2a1bb

Bug: T312528

Change-Id: I0e64a3fc4b4556bc4ea6271bd6b778ed2930ab1a
2022-10-18 14:16:45 +00:00
libraryupgrader 049deca5d7 build: Updating mediawiki/mediawiki-phan-config to 0.12.0
Change-Id: I8b7a32686e4ead725539c449a58d58c86e58783c
2022-10-09 12:08:11 +00:00
Stegmujo 2ae8f50348
Add final nodes
Related code:
fb56991251/lib/nodes/

Bug: T312528
Change-Id: I01b99430d510c0df452d1faba340e2595ae50a33
2022-09-06 14:42:37 +02:00
Stegmujo d940161a3e
Add further nodes
Related code:
fb56991251/lib/nodes/

Bug: T312528
Change-Id: I8bd30bc45d2c23214b317ca0c04aa8e7d6a2da33
2022-09-02 19:34:07 +02:00
jenkins-bot 1f4eedf891 Merge "Change type hints for TexNode" 2022-08-27 15:06:29 +00:00
Moritz Schubotz (physikerwelt) db942c2325
Replace 3 backslashes with 4
3 backslashes work as well according to

https://stackoverflow.com/a/28063081

However, it might be confusing as the behaviour would change in double qouted strings. Also mw-core seems to mostly use 4 backslashes.

https: //codesearch.wmcloud.org/core/?q=%5B%5E%5C%5C%5D%5C%5C%5C%5C%5C%5C%5B%5E%5C%5C%5D&i=nope&files=.php%24&excludeFiles=&repos=
Change-Id: I9be37c386f8ca0f9d0a7be641484654cf9a2f7fa
2022-08-27 09:13:08 +02:00
Moritz Schubotz (physikerwelt) 971b7954fe Change type hints for TexNode
Bug: T315978
Change-Id: I06004360a6538f974733021c1f06d8a5bb1f1f7b
2022-08-27 06:55:39 +00:00
Stegmujo 6be5724740 Add some basic nodes and texUtil
Texutil related functionalities and tests will come in other changeset.
Related code:
fb56991251/lib/nodes/

Bug: T312528
Change-Id: Iead338a31403348603442b43ae802270f6b1d675
2022-08-26 15:41:38 +00:00
Stegmujo 4901388cfc
Add TexNode
This is corresponding to 6c6988c4f6/lib/nodes/texnode.js

Bug: T312528
Change-Id: Idfd6826e6d15c0e70848e879dd23fc5e4cf113b5
2022-08-23 08:43:01 +02:00
Reedy b05db18e25 MathRenderer: Check output of parse_url()
Bug: T311674
Change-Id: I437c2d91d6923485da4432f32390a54c1d3abadf
2022-08-07 22:18:45 +01:00
AndreG-P 951dec1fab
REST API endpoint for popups
Implement a rest API endpoint that displays the popup that is currently
only shown on a special page.

Code was revived from Idd22057a88312bf1a1cb5546d0a6edca5678d80d

Bug: T288076
Bug: T233099
Change-Id: I65fcbf25ac5818f6c649daf494c719921247e8f5
2022-08-05 17:47:44 +09:00
AndreG-P 14c4df1336
Support new properties 'Symbol Represents' and 'In Defining Formula'
Add support for the new properties 'P9758' (symbol represents) and
'P2534' (in defining formula) for the special page that shows
in depth information about tagged formulae.

Bug: T312893
Change-Id: I39551e04487f77cca60c89e8c95293032fd5bd6a
2022-07-27 22:30:54 +09:00
Moritz Schubotz (physikerwelt) 480d241f97
Make dependency to Wikibase client config optional
The MathEntitySelector gets its config from wbRepo which caused a hard
dependency on the Wikibase client.
If the Wikibase client config is not available a default value (wikidata)
is used to determine the URL of the foreign repo.
As the dropdown will never do write operations, we restrict the repo
access to anonymous read only.

Bug: T313143
Change-Id: Iba33dfd32a78f4ad7c2e99a1f56218458ab884b4
2022-07-25 09:51:47 +02:00
jenkins-bot 12ca486684 Merge "Replace MathWikibaseConfig with ServiceOptions" 2022-07-25 07:10:18 +00:00
jenkins-bot 53a2ea9909 Merge "Provide static Factory Class for Math related services" 2022-07-25 05:52:32 +00:00
Moritz Schubotz (physikerwelt) 882c49599b
Replace MathWikibaseConfig with ServiceOptions
MathWikibaseConfig introduced additional complexity by passing through
some services to MathWikibaseConnector.
The remaining options were just a list of properties that could also be defined as ServiceOptions.

Bug: T313646
Change-Id: Ib9083c0cb62f6d972befc7f5dc3ed47f55cf92a5
2022-07-23 11:37:30 +02:00
Moritz Schubotz (physikerwelt) 73c41b4626
Provide static Factory Class for Math related services
Initially we provide one service. More services will come in
the future.

Change-Id: I98a0f5f181f729e123a063dabf3597b5effa55b8
2022-07-22 18:59:11 +02:00
Moritz Schubotz (physikerwelt) 0bec9dc904 Remove deprecated method hasSite
The method always returns true and has no obvious benefit.

Change-Id: I77727d37c16e6234cf13e0ccf5d8fe94142ddd2a
2022-07-22 12:51:21 +00:00
Moritz Schubotz (physikerwelt) a274beae78
Transform MathWikibaseConfig into a service
* add some basic tests
* migrate MathWikibaseConnectorTest to a unit test

Bug: T313331
Depends-On: Ic3b8d4f685d5cf648a02696284b6ee499502a12a
Change-Id: I38d6425eb5e2c52ae4362c4b8656223a8d9d90a5
2022-07-21 15:22:47 +02:00
Moritz Schubotz (physikerwelt) a8052d564b
Transform MathWikibaseConnector into a service
* add some basic tests
* MathWikibaseConfig should also be transformed into a service in a follow
up to allow for better testing

Bug: T313331
Change-Id: Iec7446a06d9a117cdeba9d26616f4fdf8e8540ca
2022-07-21 08:34:25 +02:00
Lucas Werkmeister 4022150d1d Use FallbackLabelDescriptionLookupFactory in MathWikibaseConfig
Lookups returned by this factory will resolve redirects; the old factory
is deprecated and will soon be removed.

Bug: T312223
Change-Id: I3d03e2e7ad646c1048f914915b84836f958b7f6e
2022-07-13 18:34:06 +02:00
jenkins-bot 3d493fed35 Merge "Remove some unused methods." 2022-06-27 19:11:49 +00:00
Stegmujo c60565c790 Remove some unused methods.
Bug: T310350
Change-Id: I0629b9a963bf57b1368ffc61f7c3b631b19f5260
2022-06-27 18:20:06 +00:00
jenkins-bot 669d53a714 Merge "schema: Move all sql files to sql folder" 2022-06-23 21:53:57 +00:00
jenkins-bot 3fc4933886 Merge "Bump minimum required version for upgrade to 1.31" 2022-06-23 21:53:56 +00:00
DannyS712 8328544d9c Start catch blocks on the same line as the preceding }
Change-Id: Ib3761884bc2ec14640f6e649ca7a704c9cea83ca
2022-06-23 00:24:02 +00:00
Umherirrender 44f7c7821a schema: Move all sql files to sql folder
It is good practice to have a folder in the root for all sql files.
Also use the engine folder to store the patches

Change-Id: Ic26c042f0a5a8ca6e0568b38c4b4b2b4f0686efb
2022-06-22 18:11:51 +00:00
Umherirrender 1290d24523 Bump minimum required version for upgrade to 1.31
Remove sql patches, mention the gerrit change to check version
- mathlatexml.mathml-length-adjustment.mysql.sql -
Id09ec6201f68efe63a439f6e85a53876d5c1e521

Change-Id: I2d66ab3203758dbe3d0c442163f010595fea5437
2022-06-22 18:09:53 +00:00
Petr Pchelko a245040c20 Remove special handling of math in sections
Originally this was added in T103269, but according
to T103269#6769990 this could not be needed anymore.
I've tested this with the original test case, and it
all works correctly without running the regex.

Change-Id: I5b3b11e71f0d6e55f158fa0d941977c823d12d51
2022-06-10 15:26:43 +00:00
Moritz Schubotz (physikerwelt) 92c4db78ef Set up mathoid and mathlatexml regardless of configuration
Set up both database tables (mathoid and mathlatexm) regardless of the enabled modes. This will allow to change configuration without having to rerun db update scripts for the price of having potentially empty tables in the db.

Bug: T307896
Change-Id: I5ed50e53835c378f9f497a6ff3a4195299259d5b
2022-06-01 10:04:10 +00:00
jenkins-bot 9e420ab960 Merge "Use new ResourceLoader namespace" 2022-05-24 23:44:32 +00:00
Tim Starling a5c7506265 Use new ResourceLoader namespace
Extensions using Phan need to be updated simultaneously with core due
to T308443.

Bug: T308718
Depends-On: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659
Change-Id: I6d355e7037186e840a76f319886ed870419d9fc8
2022-05-24 22:59:43 +00:00
lens0021 72a537e8a8 Add $wgMathUseInternalRestbasePath
Adds a new configuration variable that can be used to run RESTBase
independently from Math.

Bug: T306572
Change-Id: Ie40bd36a53fa5018364cf9268fee29533f4aa23b
2022-05-17 07:32:57 +00:00
Alexander Vorwerk 1f8553bc3a Replace usage of deprecated global function wfReadOnly()
The global function wfReadOnly() has been deprecated in favor of the
new ReadOnlyMode service. Its usages should be replaced.

Bug: T283978
Change-Id: I8f7c026961a6b65e2e45a675c54f0481ccdf09e0
2021-12-26 00:03:40 +01:00
Umherirrender da9a7bfc17 doc: Cleanup @param documentation
No extra sign needed between variable and description

Change-Id: I870cb71b6304ff1760499541190fd4cd44bf1a87
2021-11-04 22:29:36 +01:00
physikerwelt (Moritz Schubotz) b51408c4aa Remove empty string workaround
Old versions of Math returned

<dl>
<dd>iso-8859-1</dd>
</dl>

for empty math tags. This is no longer the case today.

Moreover, a problem in the png2svg conversion was fixed
in mathoid recently Iaf41f61335b4af51f758b64427c6e661ee36fb1b
This version of mathoid is now used in production.

Therefore, we can remove the handling of the special case.

Bug: T10372
Change-Id: Id835f7041a19f9519e7d5640b69a02b4b8a3397e
2021-10-03 14:42:25 +02:00
Reedy df89742072 Remove global namespace class aliases
Depends-On: I7e8e7f5ec0ac2f995489a559e88fc55ab877e06e
Change-Id: Ie3f5d5880363777eda4608fe8753a69e7ff3c5f9
2021-10-01 16:30:09 +00:00
Petr Pchelko cfc2f4f319 Register 'math' parser option
Instead of modifying a page rendering hash,
use the proper mechanism of parser option
registration. The cache is still split on parser
option value. The 'math' option is lazy, since
not all pages contain 'math' tag and we want to
avoid an user preference lookup for every parse.

WARNING: this will invalidate ParserCache for
all pages that contain <math> tags, but according
to Moritz, this is about 1% of all pages, so we
should be fine.

Setting up the test is still rather hard and weird
due to very hacky rendering mode to user option
converter, and math renderer interaction with the DB.
This will be cleaned up later.

Depends-On: I92b3e18fabef4eecac2ec2a4844f1be2716e5d89
Change-Id: I3bce04684070ad306685dabbc51267def25773cd
2021-09-30 06:55:54 -07:00
Petr Pchelko b458303fed Move rendering modes name resolution to MathConfig
Change-Id: Ie1926f1da02f6ab585d3efbc71abe1716dac66e5
2021-09-30 06:29:36 -07:00
Petr Pchelko a3306b24df Clean up handling of user preferences
Change-Id: I3e8f0a0be16d92a411de796b8e25df3a7760099f
2021-09-29 10:28:03 -07:00
Petr Pchelko 9b7205599c Move math configuration methods into a service
This is doing a bulk of the job of creating a service
for working with math modes configuration. There's
still things to do, like moving math mode names,
and perhaps depending on default user options to
provide a bit more convenience, but that will be the
next step.

Change-Id: I1259a93651920f44104f2f5135e3e620c858be8d
2021-09-28 13:31:08 -07:00
libraryupgrader 1e15355fdf build: Updating composer dependencies
* mediawiki/mediawiki-phan-config: 0.10.6 → 0.11.0
* php-parallel-lint/php-parallel-lint: 1.3.0 → 1.3.1

Change-Id: I6c13f1e5d7488e269b5ca6f26ee4aa7cc22638c1
2021-09-09 11:08:17 +00:00
physikerwelt (Moritz Schubotz) 817a56acc3
Allow rendering of <math>0</math>
Bug: T288846
Change-Id: I5c5cd3e759b245b028c42f19ba6199b8f6f48aaa
2021-08-26 11:27:54 +02:00
Petr Pchelko 2c4d8bbcf7 Support null content in parser tag hook
Bug: T288846
Change-Id: I1f3e8012db83c98f3057b01f1bd563ef327be8d3
2021-08-13 13:06:38 -07:00
Petr Pchelko da8e918fb3 Enable most tests which were previously disabled
Additionally - remove RestbaseInterface::checkBackend.
When HTTP requests are banned from unit tests this method
makes no sence.

MathoidCli tests were not reenabled cause it's a bit hard
to mock shell acceess. Hopefully as part of Shellbox
transition we can have MockShell trait in core and reenable
those tests

Bug: T265628
Depends-On: I350ed59af603a0504704af3265787a4be8f2dc2a
Change-Id: I294d0ed905193850dc38cb3071eb9b31c8863121
2021-08-12 08:57:58 -07:00