Adds MathML support for math font commands.

This is part 3 or 3.  The first two pull requests added font metrics, HTML rendering, and screenshot tests.
This commit is contained in:
Kevin Barabash
2015-07-04 15:32:31 -06:00
committed by Kevin Barabash
parent 1b5834d894
commit 64e63d7546
6 changed files with 295 additions and 74 deletions

View File

@@ -5,7 +5,6 @@
* called, to produce a final HTML tree.
*/
var Options = require("./Options");
var ParseError = require("./ParseError");
var Style = require("./Style");
@@ -1281,22 +1280,11 @@ var buildGroup = function(group, options, prev) {
* Take an entire parse tree, and build it into an appropriate set of HTML
* nodes.
*/
var buildHTML = function(tree, settings) {
var buildHTML = function(tree, options) {
// buildExpression is destructive, so we need to make a clone
// of the incoming tree so that it isn't accidentally changed
tree = JSON.parse(JSON.stringify(tree));
var startStyle = Style.TEXT;
if (settings.displayMode) {
startStyle = Style.DISPLAY;
}
// Setup the default options
var options = new Options({
style: startStyle,
size: "size5"
});
// Build the expression contained in the tree
var expression = buildExpression(tree, options);
var body = makeSpan(["base", options.style.cls()], expression);