Commit graph

3034 commits

Author SHA1 Message Date
Translation updater bot b8ca39784d
Localisation updates from https://translatewiki.net.
Change-Id: I31180655654dc8f0c962be345e7e45542de77afb
2024-11-12 07:17:19 +01:00
physikerwelt 4f72825f64 Treat colon as operator
Bug: T375974
Change-Id: Ia553e77a04edfee12fa0f236375d67a88eefee67
(cherry picked from commit fcb667f733)
2024-11-10 23:13:20 +00:00
jenkins-bot c36093d790 Merge "Remove menclose in cancel rendering" into REL1_43 2024-11-10 22:08:40 +00:00
jenkins-bot bc171091b2 Merge "Treat \operatorname as a valid operator for limits" into REL1_43 2024-11-10 22:08:39 +00:00
jenkins-bot c351432080 Merge "Ignore misplaced limits commands" into REL1_43 2024-11-10 22:08:37 +00:00
jenkins-bot 975dcf67c6 Merge "Add npm fix script" into REL1_43 2024-11-10 22:08:37 +00:00
physikerwelt b9e3c78fca Remove menclose in cancel rendering
Bug: T376829
Change-Id: I860e2f2f9bf9eef8eeba35b0999ec50175fdfc4b
2024-11-10 21:22:00 +00:00
physikerwelt 12aad83904 Treat \operatorname as a valid operator for limits
* Extend logic for checking for valid operators
* Add tests

(cherry picked from commit 775fec5450)

Bug: T365170
Change-Id: I4d3762e3258c78ac5fae8b923f12aabcd2175f3d
2024-11-10 21:21:20 +00:00
physikerwelt f068a0b74c Ignore misplaced limits commands
Instead of rendering \limits or \nolimits when those
commands are misplaced the commands are ignored.

TeX does it the same way, but issues a warning in addition.
Issuing the warning will be taken care of in a follow-up commit.

(cherry picked from commit b058d88bf9)

Bug: T365170
Change-Id: Ic1c28be2a5669183c3dd5d15577a35a1b5a76971
2024-11-10 21:20:49 +00:00
physikerwelt 3a2cb04bd3 Add npm fix script
Change-Id: Iebd8d41d36a3a05d6ff9e07248716ce1ad19668d
2024-11-10 21:19:53 +00:00
physikerwelt c8ba330ad4 Add mathfraktur rendering for chrome
Chrome and similar browsers do not support the
mathvariant attribute that can be used to change
math fonts conveniently. Like for mathcal there is
a table that can be used to translate from latin
to mathfraktur chars.

(cherry picked from commit 63b47f21ef)

Bug: T378433
Change-Id: Id8c3e121ed104ba3f08329b4151a7e3bec699754
2024-11-10 21:19:06 +00:00
physikerwelt 3e14678e2a Use cell based table rendering
(cherry picked from commit dab5364b31)

Bug: T377167
Change-Id: I6e29b47b1731638ea9b06de3006ce2834e4f0c68
2024-11-10 21:18:33 +00:00
libraryupgrader 60ee5be3c9 build: Updating mediawiki/mediawiki-codesniffer to 45.0.0
Change-Id: I4ad7bd9128406f9b5f4b01845fd51afc3aebdae7
2024-11-10 18:15:20 +00:00
Ammarpad 7bc0e492ed ext.math.popup: Add mediawiki.user in dependencies
Dependency introduced in I46e7641

Bug: T378877
Change-Id: I27f28a7adebba16370ae7010a8dbf3d9e3c5c849
(cherry picked from commit dab41da0b1)
2024-11-04 09:32:32 +00:00
physikerwelt 1cef7f0dd4 Add more operators that render limit below
* Extend the list of operators that use munder instead
  of msub.
* Use rendering of main operator, as some artificial
  spaces might be added in the operator representation

Bug: T375907
Change-Id: I45e96257411bd7641ad6cc32aaac4c94bfcfa8a3
2024-10-28 19:53:05 +00:00
Umherirrender b0921d7389 Replace isset() with null check
isset() should only be used to suppress errors, not for null check.
When the variable is always defined, there is no need to use isset.
Found by a new phan plugin (2efea9f989)
https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#isset

Change-Id: I4e797c539d8d7868bfac63fcac6b2f78463f6475
(cherry picked from commit cf6271fa06)
2024-10-28 17:07:01 +00:00
Andre Klapper 25833d1509 Use explicit nullable type on parameter arguments (for PHP 8.4)
Implicitly marking parameter $... as nullable is deprecated in PHP
8.4. The explicit nullable type must be used instead.

Bug: T376276
Change-Id: Idcd0b50c1c01a33c4cabeed3e31828f77c3f6443
(cherry picked from commit 5c6bc704a2)
2024-10-28 16:15:20 +00:00
Umherirrender 7038c68f13 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I4cf7903b9700e6366bdf349f99ffd4a04da0c087
2024-10-20 09:27:34 +02:00
Translation updater bot cecbd594d1
Localisation updates from https://translatewiki.net.
Change-Id: I034c2da50b5282ae9038054b3bda5c0921c1baf8
2024-10-18 09:25:18 +02:00
jenkins-bot 9c9c20e09e Merge "Use munder instead of msub for large operators" 2024-10-16 12:38:21 +00:00
jenkins-bot 188d13ca64 Merge "Squash literals in operatornames" 2024-10-16 12:18:09 +00:00
jenkins-bot 3c4141423e Merge "Add missing apply after operatorname" 2024-10-16 11:32:32 +00:00
jenkins-bot b236403991 Merge "Use the same formatting for align as MathJax" 2024-10-16 08:56:42 +00:00
physikerwelt 87632766e0 Squash literals in operatornames
Chains of single letter mi elements are rendered with no
space but one mi element with multiple letters gets
space. For example, the operator log will be translated
to <mi>log</mi> rather than <mi>l</mi><mi>o</mi><mi>g</mi>
as done by wikitexvc.

* Squash literals into single element, iff they don't
contain commands

Following the implementation of the literal rendering
it seems that all literals with special behaviour have
a command.

Bug: T375861
Change-Id: I97adf5f5132180503cbeb59d32fdb8d45b08aaa7
2024-10-14 16:02:17 +00:00
physikerwelt 9a27d92c09 Add missing apply after operatorname
* Reapply the logic of \log rendering to \operatorname
* Deduplicate applyFunctionDetection

Note this still does not solve the rendering problem for
operator names with more than one letter as these generate
mrow elements with single letters. Those are not rendered
with space in FF.

Bug: T375861
Change-Id: I913d865b49d5894a63c8b9d244768f9bb1df4e28
2024-10-14 16:01:56 +00:00
physikerwelt 87f0315812
Use the same formatting for align as MathJax
* Copy the default mtable attributes from MathJax
* Adjust the test

Bug: T348791
Bug: T375317
Change-Id: I274577e320056c1ac3a1f74cbc61941184afd61e
2024-10-14 17:59:19 +02:00
physikerwelt ec44827976
Use munder instead of msub for large operators
* Add new class to identify what a (large) operator is
* Add some IDE hints about what methods exist in texutil
* Add tests for operators in display and block style

Bug: T375907
Change-Id: If734f194cd8fa30efaf6d8c8d89f85e3e1c96276
2024-10-13 21:13:56 +02:00
physikerwelt 602043027d
Implement basic column info parsing
* For each letter l c or r that is found in the
  column spec the respective mtable alignment
  information is passed
* if the align information is given externally
  the info will still be ignored

Bug: T376838
Change-Id: I3113f933502df2109b066959e4d001736dbae6e6
2024-10-13 00:55:57 +02:00
Translation updater bot 9321d6ffc7
Localisation updates from https://translatewiki.net.
Change-Id: Ie8ac1996868b8d94edf063686e0a3fb8c6cdd5e7
2024-10-08 09:43:50 +02:00
jenkins-bot 65f3e1bc95 Merge "Add \| to list of special operators" 2024-10-07 12:09:14 +00:00
jenkins-bot 73e1f3d229 Merge "Change appearance for \mathcal A in MathJax" 2024-10-07 12:09:12 +00:00
jenkins-bot 3f0692a9b9 Merge "Only use Munderover for displaystyle formulae" 2024-10-07 10:29:14 +00:00
physikerwelt fec6d16b14 Change appearance for \mathcal A in MathJax
Change the appearance of \mathcal A and similar letters
in MathJax rendering to better match the MathML rendering
as implemented by browsers.

Code generously developed by Davide P. Cervone.

Bug: T375932
Change-Id: Ieee933b9863c2747559769065da6b5369d304f53
2024-10-07 10:28:52 +00:00
jenkins-bot c53b191756 Merge "Improve parsing of \big et al." 2024-10-07 10:23:47 +00:00
Translation updater bot 2e3d86ee4d
Localisation updates from https://translatewiki.net.
Change-Id: I059aa3b35d4bddadb2bc1b9dca9bc9443ff840f1
2024-10-07 09:26:14 +02:00
physikerwelt ca10252923
Add \| to list of special operators
Bug: T376546
Change-Id: Ibf57c995c2381fea095600c31ce6432a1e8fd4fd
2024-10-05 23:00:34 +02:00
physikerwelt 1872a19a78
Improve parsing of \big et al.
Add stretchy=true to more constructs after consolidating
the W3C MathWG

https://github.com/w3c/mathml-core/issues/261

Bug: T375960
Change-Id: Ie472d5a3be2dda8b4c50b0c5d091d735577e11d9
2024-10-02 00:15:36 +02:00
physikerwelt 2e10b67773
Only use Munderover for displaystyle formulae
Use msubsup for inline formulae.

Bug: T375349
Change-Id: I8a33d63b79893bfe054cfca2213d7c4091658803
2024-10-01 22:27:51 +02:00
Translation updater bot cebab4fc89
Localisation updates from https://translatewiki.net.
Change-Id: I202acac3d1b207f0618a4ac04d62686a101f2137
2024-10-01 09:37:55 +02:00
Translation updater bot fffacc1bbe
Localisation updates from https://translatewiki.net.
Change-Id: I54f37f3bde27467ff759b366df8da73929c30b89
2024-09-30 09:21:26 +02:00
physikerwelt 0e9d89b03c
Fix: Add missing latex length units
Reorder according to
http://latexref.xyz/Units-of-length.html

Bug: T375295
Change-Id: Iab54bcd3f91e0e473c34869418a1e587c2518c0c
2024-09-27 14:00:44 +02:00
jenkins-bot a35b1bf38b Merge "Workaround for WebKit XSLT issue" 2024-09-25 09:28:29 +00:00
physikerwelt 3249a59141 Workaround for WebKit XSLT issue
Use workaround from MathJax to handle problem
 with the XSLT parser in WebKit (and Blink).

Upstream Bug: https://github.com/mathjax/MathJax/issues/3030

This workaround will be included in the MathJax
 4 release and no longer be required when we
 upgrade to MathJax 4.

Bug: T375241
Change-Id: I9ebc1062093a3b56dbf0478e23d8c0064a57fafb
2024-09-22 19:46:25 +00:00
physikerwelt ff1536d1f9
Ignore length specifications after linebreaks
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
2024-09-22 20:22:52 +02:00
jenkins-bot 5489d8d693 Merge "Simplify parsing of mediawiki_function_names" 2024-09-22 12:56:15 +00:00
physikerwelt 051ab0a6f5
Fix: Use align information in matrix constructs
Pass the align information was given in the function call.

Bug: T375317
Change-Id: Ic187c2f95ad0c98724016e6eda10a1e7c9ff4888
2024-09-22 00:04:46 +02:00
physikerwelt c9f7d9131f
Simplify parsing of mediawiki_function_names
Just convert mediawiki_function_names to the respective \operatorname construct.

Bug: T375274
Change-Id: Ie374524dbdf6a753063172fb88e6f60e91b9212e
2024-09-21 00:57:23 +02:00
physikerwelt db81c96062
Fix heuristic that adds bold-italic
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
2024-09-20 08:59:27 +02:00
Umherirrender ebecba2ab9 Pass function name to HttpRequestFactory::create
Change-Id: Ic8e7aa35aea9164b4a9ae44549550d49b062361e
2024-09-19 23:20:16 +02:00
Umherirrender 9a0dccd41f specials: Get global via IContextSource::getConfig
Change-Id: I8fd45a5bf8f17e3025a80dc899a80375d7624ae8
2024-09-17 22:07:39 +02:00