Commit Graph

13 Commits

Author SHA1 Message Date
physikerwelt 94b035b26a Coverage tests for the Math extension
* Include generated tests for a better test coverage
of the Math extension.
* Compiles texvc in testsuite (if required)
* Test generator now included
* Replaces the old parser tests
* Fixes whitspace issues

Bug: 61090
Change-Id: Iff7eeb5ee72137492c3f6659e4d4d106e5715586
2014-03-11 15:35:07 +00:00
Antoine Musso fcb1faf4b5 mark parsertests with option 'texvc'
One of the parsertests had the option 'texvc', that is a nice idea to
let MediaWiki recognize such test is requiring a texvc installation.
This patch apply the option to all those parser tests.

MediaWiki core change https://gerrit.wikimedia.org/r/69872 will
recognize the option and skip the test whenever $wgTexvc is not set or
points to a non executable file.

Also cleaned out some blank lines.

bug: 49884
Change-Id: I746856be4aafa8e8ed5ef33d5b10b16db3ca97ff
2013-06-26 14:14:52 +02:00
Physikerwelt 926db7c3bd Restructuring Math classes
The Math.body file which contains the MathRender class was split in the following way:
- Math.base contains the base class with the database related stuff and provides an abstract interface
- Math.source and Math.MathJax handle the plain tex string output. There are two classes since they
  will differntiate in the future I think.
- Math.texvc contains the "old" implementation of png generation with all the file handling related stuff
- Other implementation of math renderer can be added in the same style.
- Cleanup to better follow coding conventions.
- Changed LockManager to 'fsLockManager'

The first attempt restructure the class layout and introduce LaTeXML at the same
time was dropped. Instead this was split up into two phases.
This commit only deals about the restructuring of the math module design.

Change-Id: I9b1d68c4faa8d177d8d0088fa1a5879caed4f1fe
2013-02-07 20:35:45 -08:00
Demon cb263d5b7e Merge "Update math parser test cases for new rendering defaults" 2012-04-23 18:30:47 +00:00
Suhas e5e574604b Bug 31824: Fix for the empty math tag
It fixes the bug by returning an empty string if the math tag is
empty.

Parser tests and changes so that white-text only works.

Change-Id: Ica0dbb9bcfc709331e348fb11d24673103be3b37
2012-04-08 11:50:52 -04:00
Brion Vibber c4137dcbfd Update math parser test cases for new rendering defaults
Previous parser tests assumed the older options which turned some simple bits into HTML, while new default runs everything through images.

Change-Id: I894ea42947da66f93272c56ef89b4357724ec3b9
2012-04-06 15:16:53 -07:00
Nicholas Longo a2b53e5a36 The following patches restore how texvc added braces for all commands
but \operatorname to fix Bug 31442.  More specifically, TEX_FUN1 now
adds braces as it did in previous versions.  The result is texvc will
once again correctly sanitize multiple math accents even when no braces are
given (e.g. \dot \vec B) and it will allow math accents to be used with
symbols whose font as been changed (e.g. \tilde \mathcal{M}).  Parser
tests are created to ensure these continue to work.  

The handling of \operatorname is now  handled specially by the
function TEX_FUN1nb (nb stands for no braces and the name is taken to
be consistent with the existing function TEX_FUN2nb).  The addition of
braces causes this command to LaTeX incorrectly.  The parser test for
\operatorname has been updated to reflect the fact the hash of the
images involved has changed.
2011-10-13 23:04:41 +00:00
Brion Vibber 77bbd35329 * (bug 6722) Spacing fixes for math functions with/without parens
* (bug 18912) Add math support for \sen Spanish variant of \sin
* (bug 18912) Fix spacing for \operatorname in math

Reapplies r86962, r87117, r87936, r87941 plus some parser tests.

Note that further batch testing to identify any other potential problems due to the spacing tweaks is a good idea!
2011-09-14 00:49:16 +00:00
Brion Vibber d2cf3c244b * (bug 19547): Apostrophe / single quotes in math \text{...}
Reapplied r87092 (tests added, tweaked for merge, no functional diff) to allow "'" and "`" in \text{...} bits.
I'm not convinced this is a sufficient fix -- there are probably a *lot* more where this came from.
But it doesn't hurt to add them!
2011-09-13 22:24:27 +00:00
Brion Vibber 8d495dcc32 * (bug 27754) Archaic Greek letters for math
May require texlive-lang-greek package to be installed; but it's only loaded when these bits are used.
Reapplied r87298 plus parser test case to confirm the new chars can render and the existing \digamma hasn't changed.
2011-09-13 22:14:01 +00:00
Brion Vibber dd490761b5 * (bug 27324) \euro support for <math>
Reapplied r87284 with a tweak to allow \euro through to conservative HTML output.
Parser test case added to confirm that \euro is HTMLable and the other euro variants are renderable to images.

This commit also includes tweaks to HTMLification of \phi, \varphi, and \varepsilon (conservative HTML) and changes the non-conservative HTMLification of number sets from plain letters to the dedicated Unicode chars for their symbols. These changes are not included in tests, but don't alter what input is supported.
2011-09-13 21:48:07 +00:00
Brion Vibber ae124a1e73 * (bug 26380) Add support for \widetilde to <math>
Reapplied r86965 (patch by Thenub314), plus parser test case to ensure that \widetilde{x} actually renders. (While we can't compare the contents of the image, the output hash will remain stable in the img url. Forcing $wgMathPath to a fixed fake path for parsertests.
2011-09-13 21:02:50 +00:00
Brion Vibber c4d9349786 Initial stab at breaking math/texvc out to Math extension.
* (bug 14202) $wgUseTeX has been superseded by the Math extension. To re-enable
  math conversion after upgrading, obtain the Math extension from SVN or from
  http://www.mediawiki.org/wiki/Extension:Math and add to LocalSettings.php:
  require_once "$IP/extensions/Math/Math.php";

This is an initial stab, and a few things remain to be cleaned up:
* messages need to be moved from core to extension
* MW_MATH_* constants should be moved to the extension from core
* old back-compat math names interfaces using those constants should be removed from message files
* classic edit toolbar's math button should be added from the extension (or else dropped) -- currently there's not a clean hook, but could do it by JS
* couple of things like the 'armourMath' function on Language & LanguageConverter may want to be redone just as an unconditional, if that's simpler.

Setting $wgUseTeX alone will no longer have any affect. The var's still there for the moment as a few bits still need to be fully moved out from core.
2011-04-09 00:39:40 +00:00