MCPcopy
hub / github.com/KaTeX/KaTeX / getMathML

Function getMathML

test/mathml-spec.ts:11–29  ·  view source on GitHub ↗
(expr: any, settings: any = new Settings())

Source from the content-addressed store, hash-verified

9const parseTree: any = parseTreeOrig;
10
11const getMathML = function(expr: any, settings: any = new Settings()) {
12 let startStyle = Style.TEXT;
13 if (settings.displayMode) {
14 startStyle = Style.DISPLAY;
15 }
16
17 // Setup the default options
18 const options = new Options({
19 style: startStyle,
20 maxSize: Infinity,
21 minRuleThickness: 0,
22 });
23
24 const built = buildMathML(parseTree(expr, settings), expr, options,
25 settings.displayMode);
26
27 // Strip off the surrounding <span>
28 return built.children[0].toMarkup();
29};
30
31describe("A MathML builder", function() {
32 it('should generate the right types of nodes', () => {

Callers 1

mathml-spec.tsFile · 0.85

Calls 3

buildMathMLFunction · 0.85
parseTreeFunction · 0.85
toMarkupMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…