Uses nodejs to call phantomjs that renders the
tex input using MathJax and returns a json object
that includes both the SVG and the MathML
representation.
The project was forked from
https://github.com/agrbin/svgtex.
Co-Authored-By: Gabriel Wicke <gwicke@wikimedia.org>
Co-Authored-By: Moritz Schubotz <wiki@physikerwelt.de>
Change-Id: Ie5f24006c3aacd8f61f48ca275acd63a418d7529
- Remove MathMathJax.php, which uses exactly the same output as MathSource.php.
- Make wiki2jax able to handle texvc output as a preview before MathJax rendering.
Change-Id: I1199cb34d555d2a1e57da98857f41a22cfe81df4
This way the cookie is never set and MathJax simply always follows
the MediaWiki language.
Follow up of Ibf43a3e44ea2bfdbd9fddc01c71c72ba097ff1b7
Bug: 35038
Change-Id: Ie7530d3a904fb39945ba8b8d261852c2b8cb666b
Adding the localizations which I missed when updating to 2.2 in
I9446121985ae27e65a429b5a558940ac30520d44
Forward the userlanguage from MediaWiki to MathJax
Note that MathJax preserves selected language in cookies, so once set,
you need to manually switch it every single time.
Bug: 35038
Change-Id: Ibf43a3e44ea2bfdbd9fddc01c71c72ba097ff1b7
\boldsymbol actually resulted in bold italic formatting, which was not
consistent with the texvc renderer. Use \mathbf (Bold face) instead.
Change-Id: I1a6fb07c55a2089c7acf50059a3a4a4e196812f1
Turns out that with the upgrade to 2.1 this is now included in core
MathJax, so we don't need the extension anymore.
http://docs.mathjax.org/en/latest/whats-new-2.1.html
Change-Id: I653c05aaf6d94851fdf6b1649d2d5c7477d46b7e
PS2: Make the number matcher limited to 3 digits. Fix at base 10.
Originally, but had broken merge: Iff04d5d650ae87d957d57420f71975ccdf4a5370
Change-Id: I6885ea90e920734e324b6d1d1f70af69cdeab033
This command was not yet supported. This implements it as a noop.
In MathJax it's not really useful to be able to define the background
color as sometimes is required in rendered png mode.
Bug 35186
Change-Id: If6573901bafd8599a01979bcbff89e52b51e4ffd
This gracefully handles: <span class="tex"><span class="tex"
dir="ltr">$ x^2 $</span></span>, generated when you put math tags
inside element attributes.
Change-Id: I997fc5e87b320879c99f7560fb023876ab6ef573
With the new renderTex hook of https://gerrit.wikimedia.org/r/61183
there is no need for hardcoded support for these 2 scripts. The
scripts in question should call the hook themselves.
PS2: Fix wikEd reference of jsHint
Supersedes: https://gerrit.wikimedia.org/r/23073
Bug: 35478
Change-Id: I9811832430e9ddd8a4c03f265d07529a76efc38a
Example usage: $('#wikiPreview').renderTex();
This supersedes: https://gerrit.wikimedia.org/r/23073
Bug: 35478
Change-Id: I18e2f089d56e42b8e603ac45d726942bb478580b
We move the block/inline styling (aka display vs textstyle) markup into
a filter used just before rendering. This way the 'used' formula will
not suddenly contain styling information that wasn't part of the
original formula.
Change-Id: Ie0c308c31d38581e556dc73109879c7a3d365121
The user can provide his own mathJax.config object.
Supersedes: https://gerrit.wikimedia.org/r/61182
PS2: Add relevant info for this feature to README
Bug: 35478
Change-Id: I97800317366aafcaad87ecf6644e9417c698c5da
This removes support for MathML % comments, just as with texvc
PS2: Fix for regex lookbehind issue
Change-Id: I0cb026d749733ed3dbba8faacb163be4438fc6bb
* Replace deprecated wfMsg* calls with alternatives.
* Add FIXME for occurrence I don't know how to replace.
* Update some docs.
* Sprinkle a few semi-colons over the JavaScript.
Change-Id: I755a95f8bba48a23ef8c432e232adfaef4caae70
MathJax's TeX input by default includes \href and \style commands, which can be
used to inject JavaScript and web bugs. Disabling them by overriding them with
named function macros.
Change-Id: Id21253e9d1621b5ec4e93e28361c498c484b1b7b
* drop some of the init lines that don't appear to work/be needed
* only load MathJax.js through ResourceLoader; let MathJax's loader handle the rest
This gets us working in Chrome, where previously we hadn't initialized correctly. Should also help in IE, still needs testing.
Will probably want to swap in the pre-minimized versions of the files at some point, but the expanded ones are fine at this stage of work.