* 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
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
* 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
* 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
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
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
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
We fixed this in I47b6d5b but broke it again in Ie8d8106. Let's
finally add a test for this edge-case.
Change-Id: I9a43518f9edf0fab05e76bbb02a30fefd039b77d
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
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
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
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
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
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
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
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
For development history of this changeset see:
Id96a4b1b55e3959aab81f4ba436c5ac125f2a1bb
Bug: T312528
Change-Id: I61cfdbd63f8d50b072ada05927a134686fdd53d3
For development history of this changeset see:
Id96a4b1b55e3959aab81f4ba436c5ac125f2a1bb
Bug: T312528
Change-Id: I0e64a3fc4b4556bc4ea6271bd6b778ed2930ab1a
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
Texutil related functionalities and tests will come in other changeset.
Related code:
fb56991251/lib/nodes/
Bug: T312528
Change-Id: Iead338a31403348603442b43ae802270f6b1d675
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
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
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
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
* add some basic tests
* migrate MathWikibaseConnectorTest to a unit test
Bug: T313331
Depends-On: Ic3b8d4f685d5cf648a02696284b6ee499502a12a
Change-Id: I38d6425eb5e2c52ae4362c4b8656223a8d9d90a5
* 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
Lookups returned by this factory will resolve redirects; the old factory
is deprecated and will soon be removed.
Bug: T312223
Change-Id: I3d03e2e7ad646c1048f914915b84836f958b7f6e
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
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
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
Extensions using Phan need to be updated simultaneously with core due
to T308443.
Bug: T308718
Depends-On: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659
Change-Id: I6d355e7037186e840a76f319886ed870419d9fc8
Adds a new configuration variable that can be used to run RESTBase
independently from Math.
Bug: T306572
Change-Id: Ie40bd36a53fa5018364cf9268fee29533f4aa23b
The global function wfReadOnly() has been deprecated in favor of the
new ReadOnlyMode service. Its usages should be replaced.
Bug: T283978
Change-Id: I8f7c026961a6b65e2e45a675c54f0481ccdf09e0
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
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
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
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