Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {MathJax} from "mathjax/mathjax.js";
export {MathJax} from "mathjax/mathjax.js";
import "mathjax/handlers/html.js";
let html = MathJax.HandlerFor(`
<title>Test MathJax3</title>
This is some math: \\(x+1\\).
\\[x+1\\over x-1\\]
`);
MathJax.HandleRetriesFor(function () {
html.FindMath()
.Compile()
.Typeset();
console.log(html.math);
import {MathJax} from "mathjax/mathjax.js";
export {MathJax} from "mathjax/mathjax.js";
import "mathjax/handlers/html.js";
let html = MathJax.HandlerFor("");
MathJax.HandleRetriesFor(function () {
html.TestMath(process.argv[3] || '').Compile();
console.log(html.math[0].tree);
}).catch(err => {
console.log(err.message);
console.log(err.stack.replace(/\n.*\/system\.js:(.|\n)*/,""));
});
import {MathJax} from "mathjax/mathjax.js";
export {MathJax} from "mathjax/mathjax.js";
import "mathjax/handlers/html.js";
import {MmlVisitor} from "TreeJax/lib/mml_visitor.js";
let mml = new MmlVisitor();
let html = MathJax.HandlerFor("");
MathJax.HandleRetriesFor(function () {
html.TestMath(process.argv[3] || '').Compile();
mml.visitTree(html.math[0].tree);
console.log(mml.getResult().toString());
}).catch(err => {
console.log(err.message);
console.log(err.stack.replace(/\n.*\/system\.js:(.|\n)*/,""));
});