
Summary: Move dom creation into katex.js so our tests can test non-dom things, and add some buildTree tests. Add some checks make utils.js work in node. Add support for jasmine-node, to allow for command line unit testing. Test Plan: - Make sure tests work, in both the browser and with `make test` - Make sure huxley screenshots didn't change Reviewers: alpert Reviewed By: alpert Differential Revision: http://phabricator.khanacademy.org/D13125
20 lines
415 B
JavaScript
20 lines
415 B
JavaScript
var ParseError = require("./ParseError");
|
|
|
|
var buildTree = require("./buildTree");
|
|
var parseTree = require("./parseTree");
|
|
var utils = require("./utils");
|
|
|
|
var process = function(toParse, baseNode) {
|
|
utils.clearNode(baseNode);
|
|
|
|
var tree = parseTree(toParse);
|
|
var node = buildTree(tree).toDOM();
|
|
|
|
baseNode.appendChild(node);
|
|
};
|
|
|
|
module.exports = {
|
|
process: process,
|
|
ParseError: ParseError
|
|
};
|