Output hash calcuation sometimes fails because of Texvc failure for
example, and $this->hash remains ''. At this time inserting null as
outputhash into database is improper, because that column is NOT NULL.
With this patch an empty string '' is inserted instead, and the if-check
is modified to avoid cases where ->hash exists but evaluates as null
(for example when it's '0000000000...' though it's extremely rare).
Change-Id: I852859f4b151b777c11b743faaed61dfc2c029a7
Moves writeCache call back to hooks (changed in 9ba4ef269d)
and makes it unconditional, so only one part of the code decides
whether to write to the cache.
Bug: 45973
Change-Id: I6b387795304ff15c960fcf0f5354a9ac939e1212
Change I9b1d68c4faa8d177d8d0088fa1a5879caed4f1fe added an indiscriminant call
to writeCache(). I assume that it was supposed to be regulated by the check for
$this->isRecall() (which is a getter for '$this->recall'), but there was no
concomitant change to ensure that recall is set true on cache hits.
My fix does not set recall to true. The style of "pass-by-attribute" is tricky
and should be factored out by a subsequent change. This change moves the call
to writeCache() so that it is only called on cache miss.
Change-Id: I9b690e55001859c97fd40330272791d49ec6de75
Physikerwelt asked for some guidance on how to write good unit tests for
classes that depend on external resources. I wrote a few to serve as examples
for additional tests. Because they have an ulterior didactic purpose, the
comments are a bit more verbose than I would otherwise like, but despite that
the tests are good enough to merit being merged.
Change-Id: Ifa97eec1a68fb68b4744d1e5b192b410afe5ef68
This change adds test cases for the MathSource class and registers a
hook for loading these tests. Also adds documentation about how to run
these tests in README.
Change-Id: Ie58a273326e0353dfa4437b3de21a2393adb5a87
The call to getRenderer is supposed to be a static method in the same class,
not a global function.
Change-Id: I5d101574b1d67238c6357e154209f2595cb36859
* This was changed in 926db7c3bd as a workaround for a testing issue.
* See 8cbd679aac781bdd73038064261736a937645fc1 , which fixes the test harness in core .
Change-Id: Ib57cafee35a699ce875ee4bc8951781e1a37553a
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
modules/MathJax is a third party library, we do not want to report
JSHint errors for it. Any errors there should be committed upstream.
Change-Id: I48a73eacb635149141e554853bf4aef65ecdcd49
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