mirror of
https://github.com/josdejong/mathjs.git
synced 2025-12-08 19:46:04 +00:00
Fix bug in fix of breaking change
Without this fix, the type passed to ArrayNode.toTex would stay there forever until you change it back manually instead of being used only once.
This commit is contained in:
parent
9a89ab27da
commit
a973482ef2
@ -232,6 +232,11 @@ Node.prototype.toString = function() {
|
||||
*/
|
||||
Node.prototype.toTex = function(customFunctions) {
|
||||
var customTex;
|
||||
if (this.type === 'ArrayNode') {
|
||||
//FIXME this is only a workaround for a breaking change,
|
||||
//remove this in version2
|
||||
delete this.latexType;
|
||||
}
|
||||
if (typeof customFunctions === 'object') {
|
||||
//if customFunctions is a map of callback functions
|
||||
if (customFunctions.hasOwnProperty(this.type)) {
|
||||
|
||||
@ -468,7 +468,9 @@ exports.toArgs = function(that, customFunctions) {
|
||||
if (that.args[0] instanceof ArrayNode) {
|
||||
//FIXME passing 'vmatrix' like that is really ugly
|
||||
that.args[0].latexType = 'vmatrix';
|
||||
return that.args[0].toTex(customFunctions);
|
||||
var latex = that.args[0].toTex(customFunctions);
|
||||
delete that.args[0].latexType;
|
||||
return latex;
|
||||
}
|
||||
|
||||
brace = 'vmatrix';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user