Commit graph

2918 commits

Author SHA1 Message Date
Moritz Schubotz (physikerwelt) b86ab8b4fa
Use spans for displaystyle fallback images
Previously, we were using div containers to SVG fallback images to
mimic the MathML  behaviour. This had unintended side
effects as reported in T182041.

This change uses span containers for both display and inline math
fallback images.

Bug: T182041
Change-Id: I1d563f9f3cba8a10af2665518be6c672de174333
2024-06-09 00:29:35 +02:00
Ed Sanders 008db7ad08 Update stylelint-config-wikimedia to 0.17.1
Change-Id: Ibb381be409fc34208078dd1e5c3b418465ea7692
2024-06-07 15:30:59 +01:00
Ed Sanders be3a23977a Convert more functions to arrow callbacks
Change-Id: I1701519c96731a84a3e8a16507944f3cf39d4e87
2024-06-07 15:27:20 +01:00
Ed Sanders 28dcf9e6eb Remove unnecessary local context variables
Change-Id: I662e6e5e11dbf814755792ff64dc51aac77b7d6d
2024-06-07 15:25:35 +01:00
Ed Sanders 39c15f76f9 build: Update eslint-config-wikimedia to 0.28.0 and autofix
Change-Id: I02045047af1f392ae6d6f08e422024b0e9386ccf
2024-06-07 15:24:08 +01:00
Translation updater bot cc7b93a447 Localisation updates from https://translatewiki.net.
Change-Id: I264a90e33410b7b68a30c6accdd10f8123f18731
2024-06-07 09:45:29 +02:00
jenkins-bot e4ece5aa8c Merge "Add MathJax rendering option" 2024-06-06 15:13:38 +00:00
Translation updater bot 8e351ef2c6 Localisation updates from https://translatewiki.net.
Change-Id: I04c2ea88e51334d18013211ffb43b5327eae37ee
2024-06-05 09:23:23 +02:00
Moritz Schubotz (physikerwelt) f534146597
Implement hline support for matrix
In MathML outer table boarders are represented with the
notation attribute of an menclose element. The inner
boarders are represented by the rowlines attribute
of the mtable element. The rowline element accepts
a space seperated list of row boarders. In LaTeX
the bottom line is represented by a new matrix row
that only contains \hline.

This change discover \hline elements in matrix cells
and then determines if it is in the first or last line.
When it is in the last line, the line is removed to avoid
an empty <mtr /> in the output.

Bug: T366417
Change-Id: I196e0d14a183a63696363f9e3006cf65571dc56c
2024-06-03 19:15:43 +02:00
jenkins-bot 0c3c709b51 Merge "Clean matrix arguments" 2024-06-03 10:28:18 +00:00
Moritz Schubotz (physikerwelt) 5fa3d6bfe5 Clean matrix arguments
Originally the parse tree was a binary tree, from that
time matrix element were put into that data structure.
This was partially undone, but not full which leads to some artifacts
in matrix cells.

One of the problem is that due to the binary parse
tree structure the postprocessing did not correctly
identfy \limits.

This change changes reduces nesting from matrix, and regards
matrix instances as two-dimensional TexArrays.

Bug: T362344
Change-Id: I66a31a09f204709a51d6b5c9ecefc083f7ee2d6d
2024-06-03 09:25:15 +00:00
Moritz Schubotz (physikerwelt) 4da2778a29 LaTeXML: Remove SVG fallback images
Removes Fallback images for LaTeXML rendering

Change-Id: Id158de53b3f68f85fe55a3f7ace9abdc55c21160
2024-06-03 07:06:24 +00:00
Novem Linguae 3bb26a3873 JSDoc: convert @cfg to @param
Bug: T138401
Change-Id: I105b962a46347d7d7d3f0f219b53fbdbf67b5cc2
2024-05-29 15:47:54 +00:00
jenkins-bot 024cdbb00f Merge "Make TexArray iterable" 2024-05-27 13:18:29 +00:00
jenkins-bot 3144795c42 Merge "Extend BaseParsing test coverage" 2024-05-27 07:56:44 +00:00
Moritz Schubotz (physikerwelt) 9c13fd1ccd
Make TexArray iterable
TexArray is an array of tex nodes. To improve
readability and type hinting we make TexArray
iterable.

Change-Id: I5b9b2ca63400400bc399c08445ff911f8e20a0d1
2024-05-27 09:54:44 +02:00
Translation updater bot 29e2c0e465 Localisation updates from https://translatewiki.net.
Change-Id: Iea9c3e9dccca05e928b1ab67248ab23de47ba189
2024-05-27 09:29:24 +02:00
Moritz Schubotz (physikerwelt) c0ac8ee0e7
Extend BaseParsing test coverage
Change-Id: I4e8ff663e1516bcdeb6133bb12391ad48b056367
2024-05-26 22:37:07 +02:00
Moritz Schubotz (physikerwelt) 277663b822 Add MathJax rendering option
When collecting user feedback regarding the native
rendering option on the German Wikipedia (T346795)
it became apparent that some power users aim for bigger
and bolder fonts and a more LaTeX-like layout.
MathML, however, aims to format math as an integral part
of the text with uniform fonts and spacing.

To match both user needs, this patch adds a new rendering
option that uses client-side MathJax (without a need for
restbase or mathoid).

* Adjust MathJax`s loader to be compatible with the mw loader
* Add new rendering mode
* Copy MathJax source to resource module as foreign repo

Bug: T354136
Change-Id: I1ecf9c77fefc3b0f717107d81979276023f6cb84
2024-05-24 03:30:05 +00:00
Moritz Schubotz (physikerwelt) 1befc6373d Reduce usage of lst2arr in chem context
Remove useless calls to lst2arr in chem macros

Bug: T362344
Change-Id: I05c8f525a02b10d31bf8f07638d966c0f5f33f63
2024-05-22 20:43:27 +00:00
Moritz Schubotz (physikerwelt) 6c160285fb
Reduce usage of lst2arr helper
Remove call from FUN_ARopt as the inner
expression of class expr_nosqc is of TexArray
and no unwrapping is needed.

* might reduce the number of extra curly brackets

Bug: T362344
Change-Id: If5e700e0e17c646669a0b52552e51a8b3d0b7617
2024-05-22 22:40:18 +02:00
Moritz Schubotz (physikerwelt) 5d4a406a3a Reduce usage of lst2arr helper
As expr is of type TexArray there is
no need to wrap this into another TexArray.
Additionally, this makes it makes calls to
lst2arr that unwrap the extra structure useless.

* Use fluent setters for methods used in
  grammar

For testing, one should add an assertion
to check that lst2arr is not called on
non (right-skewed) binary trees.
It is, however, not recommended
T276940 to keep the assertions in the code.

Bug: T362344
Bug: T276940
Change-Id: I037495bd0f0be6f1d634a057391fd202f5cafc86
2024-05-22 18:48:59 +00:00
Translation updater bot 872ad3717a Localisation updates from https://translatewiki.net.
Change-Id: Ic2666558791bf5f93de9888d937ccf54ab5e4fea
2024-05-20 09:25:36 +02:00
libraryupgrader 258bc0c12c build: Updating grunt-banana-checker to 0.13.0
Change-Id: If0707bae82c50a9947a1d903318b998c0bd48767
2024-05-18 16:44:47 +00:00
Translation updater bot 7f60efe1b2 Localisation updates from https://translatewiki.net.
Change-Id: I4eaa39c9f890616a35157377cf6ec9ef8530558c
2024-05-16 09:26:53 +02:00
libraryupgrader 5380b7719b build: Updating dependencies
composer:
* mediawiki/minus-x: 1.1.1 → 1.1.3

npm:
* grunt-banana-checker: 0.11.1 → 0.12.0

Change-Id: I768830ecc90b1143e1f0fda5ae2849d0bdceeba0
2024-05-11 01:57:47 +00:00
Translation updater bot 16c86e9da5 Localisation updates from https://translatewiki.net.
Change-Id: Ie64112316297c10f4e07a8d42559d6980574e7ca
2024-05-10 09:29:23 +02:00
jenkins-bot 6b8ed75f69 Merge "Support standard skin-invert class as well as mw-invert" 2024-05-09 08:34:44 +00:00
Jon Robson 808ac13c31 Support standard skin-invert class as well as mw-invert
The math equations in the article
https://en.m.wikipedia.org/wiki/0.999...?minervanightmode=1
are not showing when rendered via MathML.

After a quick look I noticed this is using mw-invert rather than
skin-invert class.

Change-Id: I7d1722c49227705fbfc0cf093c7ebe49eaeebcc5
2024-05-09 08:59:12 +02:00
Translation updater bot 75ae1aaa87 Localisation updates from https://translatewiki.net.
Change-Id: I176d3a4a35aea8b37de296dd12a3588ebb7e8aea
2024-05-06 09:26:06 +02:00
libraryupgrader 7de2b92ced build: Updating dependencies
composer:
* php-parallel-lint/php-parallel-lint: 1.3.2 → 1.4.0

npm:
* ejs: 3.1.8 → 3.1.10
  * https://github.com/advisories/GHSA-ghr5-ch3p-vcr6

Change-Id: I7c12f1a840861816de23870539171e592b43ad91
2024-05-02 08:14:06 +00:00
Translation updater bot b63f824464 Localisation updates from https://translatewiki.net.
Change-Id: I9b26fc90fc80ca1be0d229e0e2a0112cab9abb82
2024-04-29 09:23:38 +02:00
jenkins-bot e1e04a2ee6 Merge "Stop using the Xml class in this codebase" 2024-04-26 18:51:38 +00:00
Translation updater bot c4924dddda Localisation updates from https://translatewiki.net.
Change-Id: Iac0f529546a635f06f527503ba612654cf23e39e
2024-04-22 09:28:49 +02:00
jenkins-bot 8fb5044103 Merge "Use native str_starts_with/str_contains and such where possible" 2024-04-21 10:32:55 +00:00
libraryupgrader ababd67378 build: Updating eslint-config-wikimedia to 0.27.0
Change-Id: I21548e8926bdc081ce41fdc1245cb4a769234917
2024-04-20 04:25:16 +00:00
thiemowmde a5afba306a Stop using the Xml class in this codebase
There was only a single caller. Maybe a mistake or just old code
that was never updated.

As well as:
* Avoid the separate open/closeElement when possible, usually in
  favor of a single rawElement.
* Note this patch also fixes one place where a message was added to
  the HTML output without escaping.

Bug: T341775
Change-Id: I51a29b47fbd8e0269c065e4277ef775f1d659ff6
2024-04-19 19:42:19 +00:00
thiemowmde 71bd192002 Use native str_starts_with/str_contains and such where possible
Includes a few other smaller cleanups that aren't worth a separate
patch, in my opinion.

Change-Id: I42d6e70ef132bfc2cf606164e2e62becb1f915df
2024-04-19 20:48:34 +02:00
Translation updater bot 6c12bdfc8b Localisation updates from https://translatewiki.net.
Change-Id: Ibacd56045cd357ce4966cb3d6d5b3b6236563c22
2024-04-19 09:47:08 +02:00
Translation updater bot 137f874494 Localisation updates from https://translatewiki.net.
Change-Id: Ia84edc213221a235bb0f1f200d3760b77cd9240c
2024-04-17 09:28:26 +02:00
Translation updater bot 4086bc842f Localisation updates from https://translatewiki.net.
Change-Id: I468fce65dfeee37dd9e606281712472df6d685c1
2024-04-16 09:28:28 +02:00
Translation updater bot 7a71c39c4d Localisation updates from https://translatewiki.net.
Change-Id: I5e4618639bd847e1a0b7d5db88a8ef235508778b
2024-04-15 09:28:17 +02:00
jenkins-bot 05ece5f645 Merge "Don't configure parser-factory-callback" 2024-04-12 09:47:22 +00:00
jenkins-bot 06f3b1d5a3 Merge "Fix call to isCurly of null" 2024-04-11 19:48:28 +00:00
Moritz Schubotz (physikerwelt) 7423b0c347
Fix call to isCurly of null
Unfortunately, in Idcb58694022831113bdc437576bb9f48658fff2f
there is one case where the isCurly was called on an object
that can be null. The fix ensures that the method
is only called on objects that have the respective
method.

Bug: T333973
Change-Id: Ibbbc5851b37e2290616057c46859dd2f19e1c5e7
2024-04-11 16:45:21 +02:00
Translation updater bot c5756ae1a1 Localisation updates from https://translatewiki.net.
Change-Id: Ia98bc6c036cf7d97c76ca17bde79d4744bc259e6
2024-04-11 09:21:44 +02:00
Jakob Warkotsch 22a3e5fc55 Don't configure parser-factory-callback
Configuring parser-factory-callback is not necessary here because it's
the same as the default for the string value type. Setting a data type
specific custom parser will soon allow for data type specific overrides
of the parser whenever a statement value is deserialized, and setting
it may result in additional data type lookups.

Bug: T360603
Change-Id: I6a859b8d9cf25d8a837b366434380169e404fe6b
2024-04-09 19:14:44 +02:00
jenkins-bot dac2a3267a Merge "Remove curly" 2024-04-09 10:41:08 +00:00
Moritz Schubotz (physikerwelt) a102a4ed52
Remove curly
To reduce the complexity of the parse tree we remove the curly
element which is used for grouping in TeX. Instead, we use
use an attribute which defines if the group is put into curly
brackets or not. The functionality of the curly element
is transferred to the TexArray which was the only possible
child of the curly element before. To ease the transition,
we add a special constructor to TexArray.

We could not measure any performance implications of this change.

Bug: T333973
Change-Id: Idcb58694022831113bdc437576bb9f48658fff2f
2024-04-09 11:36:34 +02:00
Translation updater bot 0cc8397db2 Localisation updates from https://translatewiki.net.
Change-Id: I75a0cf23575548124c57823781983a0e6f99a84d
2024-04-09 09:27:18 +02:00