From f4f22969b050ede034c11f67b691c6acac585ff6 Mon Sep 17 00:00:00 2001 From: Rian McGuire Date: Thu, 3 Aug 2017 07:40:22 +0700 Subject: [PATCH 1/7] Clear user defined TeX macros from global state --- lib/main.js | 7 +++++++ test/macro-state.js | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/macro-state.js diff --git a/lib/main.js b/lib/main.js index 54955baf..01fe4d7e 100644 --- a/lib/main.js +++ b/lib/main.js @@ -741,6 +741,13 @@ function GetState(state) { MML.SUPER.ID = ID = 0; MathJax.OutputJax.CommonHTML.ID = 0; } + + // Clear any existing user defined macros + Object.keys(TEX.Definitions.macros).forEach(function(macroName){ + if (TEX.Definitions.macros[macroName].isUser) { + delete TEX.Definitions.macros[macroName]; + } + }); } // diff --git a/test/macro-state.js b/test/macro-state.js new file mode 100644 index 00000000..23af5db7 --- /dev/null +++ b/test/macro-state.js @@ -0,0 +1,23 @@ +var tape = require('tape'); +var mjAPI = require("../lib/main.js"); + +tape('macros should be cleared from global state', function(t) { + t.plan(2); + mjAPI.start(); + + mjAPI.typeset({ + math: "\\def\\mymacro{2\\pi} \\mymacro", + format: "TeX", + mml: true + }, function(data) { + t.false(data.errors, 'Defined and used macro'); + }); + + mjAPI.typeset({ + math: "\\mymacro", + format: "TeX", + mml: true + }, function(data) { + t.true(data.errors, '\\mymacro should no longer be defined'); + }); +}); From cb238efc24145812a6247aab91e1df4e2da01232 Mon Sep 17 00:00:00 2001 From: Rian McGuire Date: Thu, 3 Aug 2017 08:00:06 +0700 Subject: [PATCH 2/7] Allow macros to be persisted using state --- lib/main.js | 16 +++++++++++++++- test/macro-state.js | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/lib/main.js b/lib/main.js index 01fe4d7e..c3f61bec 100644 --- a/lib/main.js +++ b/lib/main.js @@ -742,12 +742,18 @@ function GetState(state) { MathJax.OutputJax.CommonHTML.ID = 0; } - // Clear any existing user defined macros + // Clear any existing user defined macros, then load macros from state Object.keys(TEX.Definitions.macros).forEach(function(macroName){ if (TEX.Definitions.macros[macroName].isUser) { delete TEX.Definitions.macros[macroName]; } }); + if (state && state.macros) { + for (var macroName in state.macros) { + TEX.Definitions.macros[macroName] = state.macros[macroName]; + TEX.Definitions.macros[macroName].isUser = true; + } + } } // @@ -772,6 +778,7 @@ function ReturnResult(result) { if (state) { var AMS = MathJax.Extension["TeX/AMSmath"]; var GLYPH = MathJax.OutputJax.SVG.BBOX.GLYPH; + var TEX = MathJax.InputJax.TeX; state.AMS.startNumber = AMS.startNumber; state.AMS.labels = AMS.labels; state.AMS.IDs = AMS.IDs; @@ -780,6 +787,13 @@ function ReturnResult(result) { state.defs = GLYPH.defs; state.n = GLYPH.n; state.ID = ID; + state.macros = {}; + for (var macroName in TEX.Definitions.macros) { + var macro = TEX.Definitions.macros[macroName]; + if (macro.isUser) { + state.macros[macroName] = macro; + } + } } serverState = STATE.READY; callback(result, originalData); diff --git a/test/macro-state.js b/test/macro-state.js index 23af5db7..e2007bb7 100644 --- a/test/macro-state.js +++ b/test/macro-state.js @@ -21,3 +21,40 @@ tape('macros should be cleared from global state', function(t) { t.true(data.errors, '\\mymacro should no longer be defined'); }); }); + +tape('macros can be persisted using state option', function(t) { + t.plan(4); + mjAPI.start(); + + var state = {}; + + mjAPI.typeset({ + math: "\\def\\mymacro{2\\pi} \\mymacro", + format: "TeX", + mml: true, + state: state + }, function(data) { + t.false(data.errors, 'Defined and used macro'); + t.equal(Object.keys(state.macros).length, 1, 'Only stores the user defined macro in state'); + + // Ensure state contains only serializable data + state = JSON.parse(JSON.stringify(state)); + + mjAPI.typeset({ + math: "\\mymacro", + format: "TeX", + mml: true, + state: state + }, function(data) { + t.false(data.errors, '\\mymacro was not persisted in state'); + }); + + mjAPI.typeset({ + math: "\\mymacro", + format: "TeX", + mml: true, + }, function(data) { + t.true(data.errors, '\\mymacro should no longer be defined if state is not provided'); + }); + }); +}); From d2f849186baf22e05134e1f0662f0f3d116285f5 Mon Sep 17 00:00:00 2001 From: Rian McGuire Date: Tue, 8 Aug 2017 08:15:35 +0700 Subject: [PATCH 3/7] Track user-defined macros by overriding setDef --- lib/main.js | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/lib/main.js b/lib/main.js index c3f61bec..571b20a1 100644 --- a/lib/main.js +++ b/lib/main.js @@ -88,6 +88,7 @@ var queue = []; // queue of typesetting requests of the form [data,callbac var data, callback, originalData; // the current queue item var errors = []; // errors collected durring the typesetting var ID = 0; // id for this SVG element +var userMacros = {}; // // The delimiters used for each of the input formats @@ -416,6 +417,22 @@ function ConfigureMathJax() { }); + // + // Track user-defined macros and environments + // + MathJax.Hub.Register.StartupHook("TeX newcommand Ready",function () { + var TEX = MathJax.InputJax.TeX, + TEXDEF = TEX.Definitions; + + var originalSetDef = TEX.Parse.prototype.setDef; + TEX.Parse.Augment({ + setDef: function (name,value) { + userMacros[name] = value; + return originalSetDef.apply(this, arguments); + }, + }); + }); + // // Reset the color extension after `autoload-all` // @@ -715,6 +732,7 @@ function StartQueue() { function GetState(state) { var SVG = MathJax.OutputJax.SVG, TEX = MathJax.InputJax.TeX, + TEXDEF = TEX.Definitions, MML = MathJax.ElementJax.mml, AMS = MathJax.Extension["TeX/AMSmath"], HUB = MathJax.Hub, HTML = MathJax.HTML, @@ -743,15 +761,16 @@ function GetState(state) { } // Clear any existing user defined macros, then load macros from state - Object.keys(TEX.Definitions.macros).forEach(function(macroName){ - if (TEX.Definitions.macros[macroName].isUser) { - delete TEX.Definitions.macros[macroName]; - } - }); + for (var name in userMacros) { + delete TEXDEF.macros[name]; + } + userMacros = {}; if (state && state.macros) { - for (var macroName in state.macros) { - TEX.Definitions.macros[macroName] = state.macros[macroName]; - TEX.Definitions.macros[macroName].isUser = true; + for (var name in state.macros) { + if (state.macros.hasOwnProperty(name)) { + userMacros[name] = TEXDEF.macros[name] = state.macros[name]; + TEXDEF.macros[name].isUser = true; + } } } } @@ -787,13 +806,7 @@ function ReturnResult(result) { state.defs = GLYPH.defs; state.n = GLYPH.n; state.ID = ID; - state.macros = {}; - for (var macroName in TEX.Definitions.macros) { - var macro = TEX.Definitions.macros[macroName]; - if (macro.isUser) { - state.macros[macroName] = macro; - } - } + state.macros = userMacros; } serverState = STATE.READY; callback(result, originalData); From 8cacb49f4bbdc021863a5b38702f4d44ab47af33 Mon Sep 17 00:00:00 2001 From: Rian McGuire Date: Tue, 8 Aug 2017 10:22:25 +0700 Subject: [PATCH 4/7] Track user-defined environments by overriding setEnv --- lib/main.js | 23 +++++++- test/macro-env-state.js | 118 ++++++++++++++++++++++++++++++++++++++++ test/macro-state.js | 60 -------------------- 3 files changed, 139 insertions(+), 62 deletions(-) create mode 100644 test/macro-env-state.js delete mode 100644 test/macro-state.js diff --git a/lib/main.js b/lib/main.js index 571b20a1..50cb650a 100644 --- a/lib/main.js +++ b/lib/main.js @@ -89,6 +89,7 @@ var data, callback, originalData; // the current queue item var errors = []; // errors collected durring the typesetting var ID = 0; // id for this SVG element var userMacros = {}; +var userEnvironment = {}; // // The delimiters used for each of the input formats @@ -418,18 +419,23 @@ function ConfigureMathJax() { }); // - // Track user-defined macros and environments + // Track user-defined macros and environment // MathJax.Hub.Register.StartupHook("TeX newcommand Ready",function () { var TEX = MathJax.InputJax.TeX, TEXDEF = TEX.Definitions; var originalSetDef = TEX.Parse.prototype.setDef; + var originalSetEnv = TEX.Parse.prototype.setEnv; TEX.Parse.Augment({ setDef: function (name,value) { userMacros[name] = value; return originalSetDef.apply(this, arguments); }, + setEnv: function (name,value) { + userEnvironment[name] = value; + return originalSetEnv.apply(this, arguments); + }, }); }); @@ -760,7 +766,7 @@ function GetState(state) { MathJax.OutputJax.CommonHTML.ID = 0; } - // Clear any existing user defined macros, then load macros from state + // Clear any existing user-defined macros and environment, then load them from state for (var name in userMacros) { delete TEXDEF.macros[name]; } @@ -773,6 +779,18 @@ function GetState(state) { } } } + for (var name in userEnvironment) { + delete TEXDEF.environment[name]; + } + userEnvironment = {}; + if (state && state.environment) { + for (var name in state.environment) { + if (state.environment.hasOwnProperty(name)) { + userEnvironment[name] = TEXDEF.environment[name] = state.environment[name]; + TEXDEF.environment[name].isUser = true; + } + } + } } // @@ -807,6 +825,7 @@ function ReturnResult(result) { state.n = GLYPH.n; state.ID = ID; state.macros = userMacros; + state.environment = userEnvironment; } serverState = STATE.READY; callback(result, originalData); diff --git a/test/macro-env-state.js b/test/macro-env-state.js new file mode 100644 index 00000000..fa0d0be5 --- /dev/null +++ b/test/macro-env-state.js @@ -0,0 +1,118 @@ +var tape = require('tape'); +var mjAPI = require("../lib/main.js"); + +tape('macros should be cleared from global state', function(t) { + t.plan(2); + mjAPI.start(); + + mjAPI.typeset({ + math: "\\def\\mymacro{2\\pi} \\mymacro", + format: "TeX", + mml: true + }, function(data) { + t.false(data.errors, 'Defined and used macro'); + }); + + mjAPI.typeset({ + math: "\\mymacro", + format: "TeX", + mml: true + }, function(data) { + t.true(data.errors, '\\mymacro should no longer be defined'); + }); +}); + +tape('macros can be persisted using state option', function(t) { + t.plan(4); + mjAPI.start(); + + var state = {}; + + mjAPI.typeset({ + math: "\\def\\mymacro{2\\pi} \\mymacro", + format: "TeX", + mml: true, + state: state + }, function(data) { + t.false(data.errors, 'Defined and used macro'); + t.equal(Object.keys(state.macros).length, 1, 'Only stores the user defined macro in state'); + + // Ensure state contains only serializable data + state = JSON.parse(JSON.stringify(state)); + + mjAPI.typeset({ + math: "\\mymacro", + format: "TeX", + mml: true, + state: state + }, function(data) { + t.false(data.errors, '\\mymacro was not persisted in state'); + }); + + mjAPI.typeset({ + math: "\\mymacro", + format: "TeX", + mml: true, + }, function(data) { + t.true(data.errors, '\\mymacro should no longer be defined if state is not provided'); + }); + }); +}); + +tape('environment should be cleared from global state', function(t) { + t.plan(2); + mjAPI.start(); + + mjAPI.typeset({ + math: "\\newenvironment{myenv}[0]{before}{after} \\begin{myenv}x\\end{myenv}", + format: "TeX", + mml: true + }, function(data) { + t.false(data.errors, 'Could not define and use environment'); + }); + + mjAPI.typeset({ + math: "\\begin{myenv}x\\end{myenv}", + format: "TeX", + mml: true + }, function(data) { + t.true(data.errors, 'myenv should no longer be defined'); + }); +}); + +tape('macros can be persisted using state option', function(t) { + t.plan(4); + mjAPI.start(); + + var state = {}; + + mjAPI.typeset({ + math: "\\newenvironment{myenv}[0]{before}{after} \\begin{myenv}x\\end{myenv}", + format: "TeX", + mml: true, + state: state + }, function(data) { + t.false(data.errors, 'Could not define and use environment'); + t.equal(Object.keys(state.environment).length, 1, 'Only stores the user defined environments in state'); + + // Ensure state contains only serializable data + state = JSON.parse(JSON.stringify(state)); + + mjAPI.typeset({ + math: "\\begin{myenv}x\\end{myenv}", + format: "TeX", + mml: true, + state: state + }, function(data) { + t.false(data.errors, 'myenv was not persisted in state'); + }); + + mjAPI.typeset({ + math: "\\begin{myenv}x\\end{myenv}", + format: "TeX", + mml: true, + }, function(data) { + t.true(data.errors, 'myenv should no longer be defined if state is not provided'); + }); + }); +}); diff --git a/test/macro-state.js b/test/macro-state.js deleted file mode 100644 index e2007bb7..00000000 --- a/test/macro-state.js +++ /dev/null @@ -1,60 +0,0 @@ -var tape = require('tape'); -var mjAPI = require("../lib/main.js"); - -tape('macros should be cleared from global state', function(t) { - t.plan(2); - mjAPI.start(); - - mjAPI.typeset({ - math: "\\def\\mymacro{2\\pi} \\mymacro", - format: "TeX", - mml: true - }, function(data) { - t.false(data.errors, 'Defined and used macro'); - }); - - mjAPI.typeset({ - math: "\\mymacro", - format: "TeX", - mml: true - }, function(data) { - t.true(data.errors, '\\mymacro should no longer be defined'); - }); -}); - -tape('macros can be persisted using state option', function(t) { - t.plan(4); - mjAPI.start(); - - var state = {}; - - mjAPI.typeset({ - math: "\\def\\mymacro{2\\pi} \\mymacro", - format: "TeX", - mml: true, - state: state - }, function(data) { - t.false(data.errors, 'Defined and used macro'); - t.equal(Object.keys(state.macros).length, 1, 'Only stores the user defined macro in state'); - - // Ensure state contains only serializable data - state = JSON.parse(JSON.stringify(state)); - - mjAPI.typeset({ - math: "\\mymacro", - format: "TeX", - mml: true, - state: state - }, function(data) { - t.false(data.errors, '\\mymacro was not persisted in state'); - }); - - mjAPI.typeset({ - math: "\\mymacro", - format: "TeX", - mml: true, - }, function(data) { - t.true(data.errors, '\\mymacro should no longer be defined if state is not provided'); - }); - }); -}); From 5b549febbbaa59327c9edc37b2ae531652e00fa8 Mon Sep 17 00:00:00 2001 From: Rian McGuire Date: Tue, 8 Aug 2017 10:43:19 +0700 Subject: [PATCH 5/7] Add missing hasOwnProperty checks --- lib/main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/main.js b/lib/main.js index 50cb650a..b225f873 100644 --- a/lib/main.js +++ b/lib/main.js @@ -768,7 +768,9 @@ function GetState(state) { // Clear any existing user-defined macros and environment, then load them from state for (var name in userMacros) { - delete TEXDEF.macros[name]; + if (userMacros.hasOwnProperty(name)) { + delete TEXDEF.macros[name]; + } } userMacros = {}; if (state && state.macros) { @@ -780,7 +782,9 @@ function GetState(state) { } } for (var name in userEnvironment) { - delete TEXDEF.environment[name]; + if (userEnvironment.hasOwnProperty(name)) { + delete TEXDEF.environment[name]; + } } userEnvironment = {}; if (state && state.environment) { From b10feb6580a5ea4558731e2a8f3ac46c6540e8ad Mon Sep 17 00:00:00 2001 From: Rian McGuire Date: Tue, 8 Aug 2017 10:45:13 +0700 Subject: [PATCH 6/7] Add comments --- lib/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/main.js b/lib/main.js index b225f873..c7f79a7e 100644 --- a/lib/main.js +++ b/lib/main.js @@ -88,8 +88,8 @@ var queue = []; // queue of typesetting requests of the form [data,callbac var data, callback, originalData; // the current queue item var errors = []; // errors collected durring the typesetting var ID = 0; // id for this SVG element -var userMacros = {}; -var userEnvironment = {}; +var userMacros = {}; // tracks user-defined macros during typesetting +var userEnvironment = {}; // tracks user-defined environments during typesetting // // The delimiters used for each of the input formats @@ -777,6 +777,7 @@ function GetState(state) { for (var name in state.macros) { if (state.macros.hasOwnProperty(name)) { userMacros[name] = TEXDEF.macros[name] = state.macros[name]; + // Set isUser on array, in case the state has been serialized and the property has been lost. TEXDEF.macros[name].isUser = true; } } @@ -791,6 +792,7 @@ function GetState(state) { for (var name in state.environment) { if (state.environment.hasOwnProperty(name)) { userEnvironment[name] = TEXDEF.environment[name] = state.environment[name]; + // Set isUser on array, in case the state has been serialized and the property has been lost. TEXDEF.environment[name].isUser = true; } } From 540b5e7a3e7996dda711c6a8f125d1f3c6c5557f Mon Sep 17 00:00:00 2001 From: Matthew Borden Date: Thu, 5 Sep 2019 20:43:35 +1000 Subject: [PATCH 7/7] Pin Mathjax Version to 2.7.6 Mathjax just updated to Version 3. This totally broke the encoding service mathjax conversion from math to text. --- package-lock.json | 278 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 140 insertions(+), 140 deletions(-) diff --git a/package-lock.json b/package-lock.json index 16a4b5fe..1dc68abe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-3.1.0.tgz", "integrity": "sha1-/YJw9x+7SZawBPqIDuXUZXOnMb8=", "requires": { - "acorn": "4.0.13" + "acorn": "^4.0.4" } }, "ajv": { @@ -27,8 +27,8 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" + "co": "^4.6.0", + "json-stable-stringify": "^1.0.1" } }, "amdefine": { @@ -79,7 +79,7 @@ "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", "optional": true, "requires": { - "tweetnacl": "0.14.5" + "tweetnacl": "^0.14.3" } }, "boom": { @@ -87,7 +87,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", "requires": { - "hoek": "2.16.3" + "hoek": "2.x.x" } }, "brace-expansion": { @@ -96,7 +96,7 @@ "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -115,7 +115,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "concat-map": { @@ -134,7 +134,7 @@ "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", "requires": { - "boom": "2.10.1" + "boom": "2.x.x" } }, "cssom": { @@ -147,7 +147,7 @@ "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", "requires": { - "cssom": "0.3.2" + "cssom": "0.3.x" } }, "dashdash": { @@ -155,7 +155,7 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { @@ -182,8 +182,8 @@ "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", "dev": true, "requires": { - "foreach": "2.0.5", - "object-keys": "1.0.11" + "foreach": "^2.0.5", + "object-keys": "^1.0.8" } }, "defined": { @@ -203,7 +203,7 @@ "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", "optional": true, "requires": { - "jsbn": "0.1.1" + "jsbn": "~0.1.0" } }, "es-abstract": { @@ -212,10 +212,10 @@ "integrity": "sha1-363ndOAb/Nl/lhgCmMRJyGI/uUw=", "dev": true, "requires": { - "es-to-primitive": "1.1.1", - "function-bind": "1.1.0", - "is-callable": "1.1.3", - "is-regex": "1.0.4" + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.0", + "is-callable": "^1.1.3", + "is-regex": "^1.0.3" } }, "es-to-primitive": { @@ -224,9 +224,9 @@ "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", "dev": true, "requires": { - "is-callable": "1.1.3", - "is-date-object": "1.0.1", - "is-symbol": "1.0.1" + "is-callable": "^1.1.1", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.1" } }, "escodegen": { @@ -234,11 +234,11 @@ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", "requires": { - "esprima": "2.7.3", - "estraverse": "1.9.3", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.2.0" + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" } }, "esprima": { @@ -277,7 +277,7 @@ "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=", "dev": true, "requires": { - "is-function": "1.0.1" + "is-function": "~1.0.0" } }, "foreach": { @@ -296,9 +296,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.12" } }, "fs.realpath": { @@ -318,7 +318,7 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" }, "dependencies": { "assert-plus": { @@ -334,12 +334,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "har-schema": { @@ -352,8 +352,8 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" + "ajv": "^4.9.1", + "har-schema": "^1.0.5" } }, "has": { @@ -362,7 +362,7 @@ "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", "dev": true, "requires": { - "function-bind": "1.1.0" + "function-bind": "^1.0.2" } }, "hawk": { @@ -370,10 +370,10 @@ "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" } }, "hoek": { @@ -386,7 +386,7 @@ "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.1.tgz", "integrity": "sha1-eb96eF6klf5mFl5zQVPzY/9UN9o=", "requires": { - "whatwg-encoding": "1.0.1" + "whatwg-encoding": "^1.0.1" } }, "http-signature": { @@ -394,9 +394,9 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.0", - "sshpk": "1.13.1" + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "iconv-lite": { @@ -410,8 +410,8 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -444,7 +444,7 @@ "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", "dev": true, "requires": { - "has": "1.0.1" + "has": "^1.0.1" } }, "is-symbol": { @@ -474,25 +474,25 @@ "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-9.12.0.tgz", "integrity": "sha1-6MVG//ywbADUgzyoRBD+1/igl9Q=", "requires": { - "abab": "1.0.3", - "acorn": "4.0.13", - "acorn-globals": "3.1.0", - "array-equal": "1.0.0", - "content-type-parser": "1.0.1", - "cssom": "0.3.2", - "cssstyle": "0.2.37", - "escodegen": "1.8.1", - "html-encoding-sniffer": "1.0.1", - "nwmatcher": "1.4.1", - "parse5": "1.5.1", - "request": "2.81.0", - "sax": "1.2.4", - "symbol-tree": "3.2.2", - "tough-cookie": "2.3.2", - "webidl-conversions": "4.0.1", - "whatwg-encoding": "1.0.1", - "whatwg-url": "4.8.0", - "xml-name-validator": "2.0.1" + "abab": "^1.0.3", + "acorn": "^4.0.4", + "acorn-globals": "^3.1.0", + "array-equal": "^1.0.0", + "content-type-parser": "^1.0.1", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": ">= 0.2.37 < 0.3.0", + "escodegen": "^1.6.1", + "html-encoding-sniffer": "^1.0.1", + "nwmatcher": ">= 1.3.9 < 2.0.0", + "parse5": "^1.5.1", + "request": "^2.79.0", + "sax": "^1.2.1", + "symbol-tree": "^3.2.1", + "tough-cookie": "^2.3.2", + "webidl-conversions": "^4.0.0", + "whatwg-encoding": "^1.0.1", + "whatwg-url": "^4.3.0", + "xml-name-validator": "^2.0.1" } }, "json-schema": { @@ -505,7 +505,7 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "requires": { - "jsonify": "0.0.0" + "jsonify": "~0.0.0" } }, "json-stringify-safe": { @@ -541,14 +541,14 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "mathjax": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/mathjax/-/mathjax-2.7.1.tgz", - "integrity": "sha1-yC0vhTsvWPc44zVTKa3wstj4+s4=" + "version": "2.7.6", + "resolved": "https://registry.npmjs.org/mathjax/-/mathjax-2.7.6.tgz", + "integrity": "sha512-RKFn28kVFSL9xyy6aCoI5fj/Vb9yCr4sI5VdzrKy95FuN7zngJfNZNqWezSVjNYFjZ8Dfrap5GoYcPqqhKWSkA==" }, "mime-db": { "version": "1.27.0", @@ -560,7 +560,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz", "integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=", "requires": { - "mime-db": "1.27.0" + "mime-db": "~1.27.0" } }, "minimatch": { @@ -569,7 +569,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -606,7 +606,7 @@ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "optionator": { @@ -614,12 +614,12 @@ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" } }, "parse5": { @@ -664,28 +664,28 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.6.0", - "uuid": "3.1.0" + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~4.2.1", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "performance-now": "^0.2.0", + "qs": "~6.4.0", + "safe-buffer": "^5.0.1", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.0.0" } }, "resolve": { @@ -694,7 +694,7 @@ "integrity": "sha1-ZVkHw0aahoDcLeOidaj91paR8OU=", "dev": true, "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } }, "resumer": { @@ -703,7 +703,7 @@ "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", "dev": true, "requires": { - "through": "2.3.8" + "through": "~2.3.4" } }, "safe-buffer": { @@ -721,7 +721,7 @@ "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", "requires": { - "hoek": "2.16.3" + "hoek": "2.x.x" } }, "source-map": { @@ -730,7 +730,7 @@ "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", "optional": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } }, "sshpk": { @@ -738,14 +738,14 @@ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "tweetnacl": "~0.14.0" }, "dependencies": { "assert-plus": { @@ -761,9 +761,9 @@ "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", "dev": true, "requires": { - "define-properties": "1.1.2", - "es-abstract": "1.7.0", - "function-bind": "1.1.0" + "define-properties": "^1.1.2", + "es-abstract": "^1.5.0", + "function-bind": "^1.0.2" } }, "stringstream": { @@ -782,19 +782,19 @@ "integrity": "sha512-ePzu2KfZYVtq0v+KKGxBJ9HJWYZ4MaQWeGabD+KpVdMKRen3NJPf6EiwA5BxfMkhQPGtCwnOFWelcB39bhOUng==", "dev": true, "requires": { - "deep-equal": "1.0.1", - "defined": "1.0.0", - "for-each": "0.3.2", - "function-bind": "1.1.0", - "glob": "7.1.2", - "has": "1.0.1", - "inherits": "2.0.3", - "minimist": "1.2.0", - "object-inspect": "1.2.2", - "resolve": "1.3.3", - "resumer": "0.0.0", - "string.prototype.trim": "1.1.2", - "through": "2.3.8" + "deep-equal": "~1.0.1", + "defined": "~1.0.0", + "for-each": "~0.3.2", + "function-bind": "~1.1.0", + "glob": "~7.1.2", + "has": "~1.0.1", + "inherits": "~2.0.3", + "minimist": "~1.2.0", + "object-inspect": "~1.2.2", + "resolve": "~1.3.3", + "resumer": "~0.0.0", + "string.prototype.trim": "~1.1.2", + "through": "~2.3.8" } }, "through": { @@ -808,7 +808,7 @@ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", "requires": { - "punycode": "1.4.1" + "punycode": "^1.4.1" } }, "tr46": { @@ -821,7 +821,7 @@ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "^5.0.1" } }, "tweetnacl": { @@ -835,7 +835,7 @@ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, "uuid": { @@ -869,8 +869,8 @@ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-4.8.0.tgz", "integrity": "sha1-0pgaqRSMHgCkHFphMRZqtGg7vMA=", "requires": { - "tr46": "0.0.3", - "webidl-conversions": "3.0.1" + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" }, "dependencies": { "webidl-conversions": { diff --git a/package.json b/package.json index 94de7ce7..b89f8a80 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "jsdom": "7.0 - 9.12", - "mathjax": "*" + "mathjax": "2.7.6" }, "scripts": { "test": "tape test/*.js"