mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-19 09:38:40 +00:00
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:
committed by
Kevin Barabash
parent
1b5834d894
commit
64e63d7546
@@ -1,15 +1,30 @@
|
||||
|
||||
var buildHTML = require("./buildHTML");
|
||||
var buildMathML = require("./buildMathML");
|
||||
var buildCommon = require("./buildCommon");
|
||||
var Options = require("./Options");
|
||||
var Settings = require("./Settings");
|
||||
var Style = require("./Style");
|
||||
|
||||
var makeSpan = buildCommon.makeSpan;
|
||||
|
||||
var buildTree = function(tree, expression, settings) {
|
||||
settings = settings || new Settings({});
|
||||
|
||||
var startStyle = Style.TEXT;
|
||||
if (settings.displayMode) {
|
||||
startStyle = Style.DISPLAY;
|
||||
}
|
||||
|
||||
// Setup the default options
|
||||
var options = new Options({
|
||||
style: startStyle,
|
||||
size: "size5"
|
||||
});
|
||||
|
||||
// `buildHTML` sometimes messes with the parse tree (like turning bins ->
|
||||
// ords), so we build the MathML version first.
|
||||
var mathMLNode = buildMathML(tree, expression, settings);
|
||||
var htmlNode = buildHTML(tree, settings);
|
||||
var mathMLNode = buildMathML(tree, expression, options);
|
||||
var htmlNode = buildHTML(tree, options);
|
||||
|
||||
var katexNode = makeSpan(["katex"], [
|
||||
mathMLNode, htmlNode
|
||||
|
Reference in New Issue
Block a user