mathjax-node
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -41,3 +41,3 @@ /********************************************************************* | ||
var extensions = ''; // no additional extensions used | ||
var fontURL = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/fonts/HTML-CSS'; // location of web fonts for CHTML | ||
var fontURL = ''; // location of web fonts for CHTML | ||
@@ -343,3 +343,6 @@ var defaults = { | ||
delete STYLES[".mjx-ex-boxtest"]; | ||
// fontURL to current MathJax version | ||
if (!fontURL){ | ||
fontURL = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/' + MathJax.version + '/fonts/HTML-CSS'; | ||
} | ||
CHTML.Augment({ | ||
@@ -346,0 +349,0 @@ webfontDir: fontURL, |
{ | ||
"name": "mathjax-node", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"lockfileVersion": 1, | ||
@@ -132,2 +132,7 @@ "requires": true, | ||
}, | ||
"core-util-is": { | ||
"version": "1.0.2", | ||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", | ||
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" | ||
}, | ||
"cryptiles": { | ||
@@ -211,9 +216,10 @@ "version": "2.0.5", | ||
"es-abstract": { | ||
"version": "1.7.0", | ||
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.7.0.tgz", | ||
"integrity": "sha1-363ndOAb/Nl/lhgCmMRJyGI/uUw=", | ||
"version": "1.8.0", | ||
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.8.0.tgz", | ||
"integrity": "sha512-Cf9/h5MrXtExM20gSS55YFrGKCyPrRBjIVBtVyy8vmlsDfe0NPKMWj65tPLgzyfPuapWxh5whpXCtW4+AW5mRg==", | ||
"dev": true, | ||
"requires": { | ||
"es-to-primitive": "1.1.1", | ||
"function-bind": "1.1.0", | ||
"function-bind": "1.1.1", | ||
"has": "1.0.1", | ||
"is-callable": "1.1.3", | ||
@@ -267,5 +273,5 @@ "is-regex": "1.0.4" | ||
"extsprintf": { | ||
"version": "1.0.2", | ||
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", | ||
"integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=" | ||
"version": "1.3.0", | ||
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", | ||
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" | ||
}, | ||
@@ -304,3 +310,3 @@ "fast-levenshtein": { | ||
"combined-stream": "1.0.5", | ||
"mime-types": "2.1.15" | ||
"mime-types": "2.1.16" | ||
} | ||
@@ -315,5 +321,5 @@ }, | ||
"function-bind": { | ||
"version": "1.1.0", | ||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz", | ||
"integrity": "sha1-FhdnFMgBeY5Ojyz391KUZ7tKV3E=", | ||
"version": "1.1.1", | ||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", | ||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", | ||
"dev": true | ||
@@ -370,3 +376,3 @@ }, | ||
"requires": { | ||
"function-bind": "1.1.0" | ||
"function-bind": "1.1.1" | ||
} | ||
@@ -404,3 +410,3 @@ }, | ||
"assert-plus": "0.2.0", | ||
"jsprim": "1.4.0", | ||
"jsprim": "1.4.1", | ||
"sshpk": "1.13.1" | ||
@@ -499,3 +505,3 @@ } | ||
"tough-cookie": "2.3.2", | ||
"webidl-conversions": "4.0.1", | ||
"webidl-conversions": "4.0.2", | ||
"whatwg-encoding": "1.0.1", | ||
@@ -530,10 +536,10 @@ "whatwg-url": "4.8.0", | ||
"jsprim": { | ||
"version": "1.4.0", | ||
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", | ||
"integrity": "sha1-o7h+QCmNjDgFUtjMdiigu5WiKRg=", | ||
"version": "1.4.1", | ||
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", | ||
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", | ||
"requires": { | ||
"assert-plus": "1.0.0", | ||
"extsprintf": "1.0.2", | ||
"extsprintf": "1.3.0", | ||
"json-schema": "0.2.3", | ||
"verror": "1.3.6" | ||
"verror": "1.10.0" | ||
}, | ||
@@ -558,17 +564,17 @@ "dependencies": { | ||
"mathjax": { | ||
"version": "2.7.1", | ||
"resolved": "https://registry.npmjs.org/mathjax/-/mathjax-2.7.1.tgz", | ||
"integrity": "sha1-yC0vhTsvWPc44zVTKa3wstj4+s4=" | ||
"version": "2.7.2", | ||
"resolved": "https://registry.npmjs.org/mathjax/-/mathjax-2.7.2.tgz", | ||
"integrity": "sha512-Z9te7r3lsjZibugO1uKsdyqICKXVNr7M1Ll2GtjJu9cUKvOvwDqEp0YIjBD4H58NNuPg5DP5/AQ2Tu8K52Mqng==" | ||
}, | ||
"mime-db": { | ||
"version": "1.27.0", | ||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz", | ||
"integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=" | ||
"version": "1.29.0", | ||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.29.0.tgz", | ||
"integrity": "sha1-SNJtI1WJZRcErFkWygYAGRQmaHg=" | ||
}, | ||
"mime-types": { | ||
"version": "2.1.15", | ||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz", | ||
"integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=", | ||
"version": "2.1.16", | ||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.16.tgz", | ||
"integrity": "sha1-K4WKUuXs1RbbiXrCvodIeDBpjiM=", | ||
"requires": { | ||
"mime-db": "1.27.0" | ||
"mime-db": "1.29.0" | ||
} | ||
@@ -602,5 +608,5 @@ }, | ||
"object-inspect": { | ||
"version": "1.2.2", | ||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.2.2.tgz", | ||
"integrity": "sha1-yCEV5PzIiK6hTWTCLk8X9qcNXlo=", | ||
"version": "1.3.0", | ||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.3.0.tgz", | ||
"integrity": "sha512-OHHnLgLNXpM++GnJRyyhbr2bwl3pPVm4YvaraHrRvDt/N3r+s/gDVHciA7EJBTkijKXj61ssgSAikq1fb0IBRg==", | ||
"dev": true | ||
@@ -691,3 +697,3 @@ }, | ||
"json-stringify-safe": "5.0.1", | ||
"mime-types": "2.1.15", | ||
"mime-types": "2.1.16", | ||
"oauth-sign": "0.8.2", | ||
@@ -704,5 +710,5 @@ "performance-now": "0.2.0", | ||
"resolve": { | ||
"version": "1.3.3", | ||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.3.3.tgz", | ||
"integrity": "sha1-ZVkHw0aahoDcLeOidaj91paR8OU=", | ||
"version": "1.4.0", | ||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", | ||
"integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", | ||
"dev": true, | ||
@@ -778,4 +784,4 @@ "requires": { | ||
"define-properties": "1.1.2", | ||
"es-abstract": "1.7.0", | ||
"function-bind": "1.1.0" | ||
"es-abstract": "1.8.0", | ||
"function-bind": "1.1.1" | ||
} | ||
@@ -794,5 +800,5 @@ }, | ||
"tape": { | ||
"version": "4.7.0", | ||
"resolved": "https://registry.npmjs.org/tape/-/tape-4.7.0.tgz", | ||
"integrity": "sha512-ePzu2KfZYVtq0v+KKGxBJ9HJWYZ4MaQWeGabD+KpVdMKRen3NJPf6EiwA5BxfMkhQPGtCwnOFWelcB39bhOUng==", | ||
"version": "4.8.0", | ||
"resolved": "https://registry.npmjs.org/tape/-/tape-4.8.0.tgz", | ||
"integrity": "sha512-TWILfEnvO7I8mFe35d98F6T5fbLaEtbFTG/lxWvid8qDfFTxt19EBijWmB4j3+Hoh5TfHE2faWs73ua+EphuBA==", | ||
"dev": true, | ||
@@ -803,3 +809,3 @@ "requires": { | ||
"for-each": "0.3.2", | ||
"function-bind": "1.1.0", | ||
"function-bind": "1.1.1", | ||
"glob": "7.1.2", | ||
@@ -809,4 +815,4 @@ "has": "1.0.1", | ||
"minimist": "1.2.0", | ||
"object-inspect": "1.2.2", | ||
"resolve": "1.3.3", | ||
"object-inspect": "1.3.0", | ||
"resolve": "1.4.0", | ||
"resumer": "0.0.0", | ||
@@ -864,13 +870,22 @@ "string.prototype.trim": "1.1.2", | ||
"verror": { | ||
"version": "1.3.6", | ||
"resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", | ||
"integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", | ||
"version": "1.10.0", | ||
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", | ||
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", | ||
"requires": { | ||
"extsprintf": "1.0.2" | ||
"assert-plus": "1.0.0", | ||
"core-util-is": "1.0.2", | ||
"extsprintf": "1.3.0" | ||
}, | ||
"dependencies": { | ||
"assert-plus": { | ||
"version": "1.0.0", | ||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", | ||
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" | ||
} | ||
} | ||
}, | ||
"webidl-conversions": { | ||
"version": "4.0.1", | ||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.1.tgz", | ||
"integrity": "sha1-gBWherg+fhsxFjhIas6B2mziBqA=" | ||
"version": "4.0.2", | ||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", | ||
"integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" | ||
}, | ||
@@ -877,0 +892,0 @@ "whatwg-encoding": { |
{ | ||
"name": "mathjax-node", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "API's for calling MathJax from node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -99,6 +99,8 @@ # mathjax-node [![Build Status](https://travis-ci.org/mathjax/MathJax-node.svg?branch=develop)](https://travis-ci.org/mathjax/MathJax-node) | ||
### `typeset(options, callback)` | ||
### `typeset(options[, callback])` | ||
The `typeset` method is the main method of mathjax-node. It expects a configuration object `input` and a `callback`. | ||
The `typeset` method is the main method of mathjax-node. It expects a configuration object `options` and optionally a callback. | ||
If no `callback` is passed, it will return a Promise. | ||
Once called, `typeset` can be called repeatedly and will optionally store information across calls (see `state` below). | ||
@@ -136,5 +138,5 @@ | ||
### `callback(result, options)` | ||
### `Promise.resolve(result,options)` / `Promise.reject(errors)` / `callback(result, options)` | ||
mathjax-node returns two objects to the `callback`: a `result` object as well as the original input `options`. | ||
mathjax-node returns two objects to `Promise.resolve` or `callback`: a `result` object and the original input `options`. | ||
@@ -170,2 +172,4 @@ The `result` object will contain (at most) the following structure: | ||
The `options` contains the configuration object passed to `typeset`; this can be useful for passing other data along or for identifying which `typeset()` call is associated with this `callback` call (in case you use the same `callback` function for more than one `typeset()`). | ||
If the `errors` array is non-empty, the Promise will reject, and be passed the `errors` array. | ||
The `options` contains the configuration object passed to `typeset`; this can be useful for passing other data along or for identifying which `typeset()` call is associated with this (`callback`) call (in case you use the same `callback` function for more than one `typeset()`). |
var tape = require('tape'); | ||
var mjAPI = require("../lib/main.js"); | ||
var mjVersion = require('../package-lock.json').dependencies['mathjax'].version | ||
@@ -13,3 +14,3 @@ tape('basic configuration: check fontURL', function (t) { | ||
}, function (result, data) { | ||
t.ok(result.css.indexOf('https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/fonts/HTML-CSS') > -1, 'Default fontURL'); | ||
t.ok(result.css.indexOf('https://cdnjs.cloudflare.com/ajax/libs/mathjax/' + mjVersion + '/fonts/HTML-CSS') > -1, 'Default fontURL'); | ||
}); | ||
@@ -19,3 +20,3 @@ // reconfigure | ||
math: '' | ||
}, function(){ | ||
}, function () { | ||
mjAPI.config({ | ||
@@ -33,2 +34,2 @@ fontURL: 'https://example.com' | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
122522
2639
173