// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`A begin/end parser should grab \\arraystretch 1`] = `
[
{
"type": "array",
"arraystretch": 1.5,
"body": [
[
{
"type": "styling",
"body": [
{
"type": "ordgroup",
"body": [
{
"type": "mathord",
"loc": {
"end": 37,
"lexer": {
"input": "\\\\def\\\\arraystretch{1.5}\\\\begin{matrix}a&b\\\\\\\\c&d\\\\end{matrix}",
"lastIndex": 56
},
"start": 36
},
"mode": "math",
"text": "a"
}
],
"mode": "math"
}
],
"mode": "math",
"style": "text"
},
{
"type": "styling",
"body": [
{
"type": "ordgroup",
"body": [
{
"type": "mathord",
"loc": {
"end": 39,
"lexer": {
"input": "\\\\def\\\\arraystretch{1.5}\\\\begin{matrix}a&b\\\\\\\\c&d\\\\end{matrix}",
"lastIndex": 56
},
"start": 38
},
"mode": "math",
"text": "b"
}
],
"mode": "math"
}
],
"mode": "math",
"style": "text"
}
],
[
{
"type": "styling",
"body": [
{
"type": "ordgroup",
"body": [
{
"type": "mathord",
"loc": {
"end": 42,
"lexer": {
"input": "\\\\def\\\\arraystretch{1.5}\\\\begin{matrix}a&b\\\\\\\\c&d\\\\end{matrix}",
"lastIndex": 56
},
"start": 41
},
"mode": "math",
"text": "c"
}
],
"mode": "math"
}
],
"mode": "math",
"style": "text"
},
{
"type": "styling",
"body": [
{
"type": "ordgroup",
"body": [
{
"type": "mathord",
"loc": {
"end": 44,
"lexer": {
"input": "\\\\def\\\\arraystretch{1.5}\\\\begin{matrix}a&b\\\\\\\\c&d\\\\end{matrix}",
"lastIndex": 56
},
"start": 43
},
"mode": "math",
"text": "d"
}
],
"mode": "math"
}
],
"mode": "math",
"style": "text"
}
]
],
"hLinesBeforeRow": [
[
],
[
],
[
]
],
"hskipBeforeAndAfter": false,
"mode": "math",
"rowGaps": [
null
]
}
]
`;
exports[`A font parser \\boldsymbol should inherit mbin/mrel from argument 1`] = `
[
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0,
"height": 0.43056,
"italic": 0,
"maxFontSize": 1,
"skew": 0,
"style": {
},
"text": "a",
"width": 0.52859
},
{
"attributes": {
},
"children": [
{
"attributes": {
},
"children": [
],
"classes": [
"mord"
],
"depth": 0,
"height": 0,
"maxFontSize": 0,
"style": {
}
}
],
"classes": [
"mord"
],
"depth": 0,
"height": 0,
"maxFontSize": 0,
"style": {
}
},
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0,
"height": 0.69444,
"italic": 0,
"maxFontSize": 1,
"skew": 0,
"style": {
},
"text": "b",
"width": 0.42917
},
{
"attributes": {
},
"children": [
],
"classes": [
"mspace"
],
"depth": 0,
"height": 0,
"maxFontSize": 0,
"style": {
"marginRight": "0.2777777777777778em"
}
},
{
"attributes": {
},
"children": [
{
"attributes": {
},
"children": [
{
"classes": [
"mrel",
"mathbf"
],
"depth": -0.10889,
"height": 0.39111,
"italic": 0,
"maxFontSize": 1,
"skew": 0,
"style": {
},
"text": "=",
"width": 0.89444
}
],
"classes": [
"mord"
],
"depth": 0,
"height": 0.39111,
"maxFontSize": 1,
"style": {
}
}
],
"classes": [
"mrel"
],
"depth": 0,
"height": 0.39111,
"maxFontSize": 1,
"style": {
}
},
{
"attributes": {
},
"children": [
],
"classes": [
"mspace"
],
"depth": 0,
"height": 0,
"maxFontSize": 0,
"style": {
"marginRight": "0.2777777777777778em"
}
},
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0,
"height": 0.43056,
"italic": 0,
"maxFontSize": 1,
"skew": 0.05556,
"style": {
},
"text": "c",
"width": 0.43276
},
{
"attributes": {
},
"children": [
],
"classes": [
"mspace"
],
"depth": 0,
"height": 0,
"maxFontSize": 0,
"style": {
"marginRight": "0.2222222222222222em"
}
},
{
"attributes": {
},
"children": [
{
"attributes": {
},
"children": [
{
"classes": [
"mord",
"mathbf"
],
"depth": 0.13333,
"height": 0.63333,
"italic": 0,
"maxFontSize": 1,
"skew": 0,
"style": {
},
"text": "+",
"width": 0.89444
}
],
"classes": [
"mord"
],
"depth": 0.13333,
"height": 0.63333,
"maxFontSize": 1,
"style": {
}
}
],
"classes": [
"mbin"
],
"depth": 0.13333,
"height": 0.63333,
"maxFontSize": 1,
"style": {
}
},
{
"attributes": {
},
"children": [
],
"classes": [
"mspace"
],
"depth": 0,
"height": 0,
"maxFontSize": 0,
"style": {
"marginRight": "0.2222222222222222em"
}
},
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0,
"height": 0.69444,
"italic": 0,
"maxFontSize": 1,
"skew": 0.16667,
"style": {
},
"text": "d",
"width": 0.52049
},
{
"attributes": {
},
"children": [
],
"classes": [
"mspace"
],
"depth": 0,
"height": 0,
"maxFontSize": 0,
"style": {
"marginRight": "0.2222222222222222em"
}
},
{
"attributes": {
},
"children": [
{
"attributes": {
},
"children": [
{
"classes": [
"mord",
"mathbf"
],
"depth": 0.13333,
"height": 0.63333,
"italic": 0,
"maxFontSize": 1,
"skew": 0,
"style": {
},
"text": "+",
"width": 0.89444
},
{
"classes": [
"mord",
"mathbf"
],
"depth": 0.13333,
"height": 0.63333,
"italic": 0,
"maxFontSize": 1,
"skew": 0,
"style": {
},
"text": "+",
"width": 0.89444
}
],
"classes": [
"mord"
],
"depth": 0.13333,
"height": 0.63333,
"maxFontSize": 1,
"style": {
}
}
],
"classes": [
"mbin"
],
"depth": 0.13333,
"height": 0.63333,
"maxFontSize": 1,
"style": {
}
},
{
"attributes": {
},
"children": [
],
"classes": [
"mspace"
],
"depth": 0,
"height": 0,
"maxFontSize": 0,
"style": {
"marginRight": "0.2222222222222222em"
}
},
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0,
"height": 0.43056,
"italic": 0,
"maxFontSize": 1,
"skew": 0.05556,
"style": {
},
"text": "e",
"width": 0.46563
},
{
"attributes": {
},
"children": [
{
"attributes": {
},
"children": [
{
"classes": [
"mord",
"boldsymbol"
],
"depth": 0,
"height": 0.44444,
"italic": 0,
"maxFontSize": 1,
"skew": 0,
"style": {
},
"text": "x",
"width": 0.65903
},
{
"classes": [
"mord",
"boldsymbol"
],
"depth": 0.19444,
"height": 0.44444,
"italic": 0.03704,
"maxFontSize": 1,
"skew": 0,
"style": {
},
"text": "y",
"width": 0.59028
},
{
"classes": [
"mord",
"boldsymbol"
],
"depth": 0,
"height": 0.44444,
"italic": 0.04213,
"maxFontSize": 1,
"skew": 0,
"style": {
},
"text": "z",
"width": 0.55509
}
],
"classes": [
"mord"
],
"depth": 0.19444,
"height": 0.44444,
"maxFontSize": 1,
"style": {
}
}
],
"classes": [
"mord"
],
"depth": 0.19444,
"height": 0.44444,
"maxFontSize": 1,
"style": {
}
},
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0.19444,
"height": 0.69444,
"italic": 0.10764,
"maxFontSize": 1,
"skew": 0.16667,
"style": {
},
"text": "f",
"width": 0.48959
}
]
`;
exports[`A macro expander \\let should consume one optional space after equals sign 1`] = `
[
{
"type": "ordgroup",
"body": [
{
"type": "font",
"body": {
"type": "ordgroup",
"body": [
{
"type": "mathord",
"loc": {
"end": 39,
"lexer": {
"input": "\\\\def\\\\bold{\\\\bgroup\\\\bf\\\\let\\\\next= }\\\\bold{a}",
"lastIndex": 40
},
"start": 38
},
"mode": "math",
"text": "a"
}
],
"mode": "math"
},
"font": "mathbf",
"mode": "math"
}
],
"loc": null,
"mode": "math"
}
]
`;
exports[`A parse tree generator generates a tree 1`] = `
[
{
"type": "supsub",
"base": {
"type": "mathord",
"mode": "math",
"text": "\\\\sigma"
},
"mode": "math",
"sup": {
"type": "textord",
"mode": "math",
"text": "2"
}
}
]
`;
exports[`A parser that does not throw on unsupported commands should build katex-error span for other type of KaTeX error 1`] = `
{
"attributes": {
"style": "color:#933",
"title": "ParseError: KaTeX parse error: Double superscript at position 4: 2^2^̲2"
},
"children": [
{
"classes": [
],
"depth": 0,
"height": 0,
"italic": 0,
"maxFontSize": 0,
"skew": 0,
"style": {
},
"text": "2^2^2",
"width": 0
}
],
"classes": [
"katex-error"
],
"depth": 0,
"height": 0,
"maxFontSize": 0,
"style": {
}
}
`;
exports[`A parser that does not throw on unsupported commands should properly escape LaTeX in errors 1`] = `
2^&"<>
`;
exports[`An HTML extension builder should not affect spacing 1`] = `
[
{
"attributes": {
"id": "a"
},
"children": [
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0,
"height": 0.43056,
"italic": 0,
"maxFontSize": 1,
"skew": 0.02778,
"style": {
},
"text": "x",
"width": 0.57153
},
{
"attributes": {
},
"children": [
],
"classes": [
"mspace"
],
"depth": 0,
"height": 0,
"maxFontSize": 0,
"style": {
"marginRight": "0.2222222222222222em"
}
},
{
"classes": [
"mbin"
],
"depth": 0.08333,
"height": 0.58333,
"italic": 0,
"maxFontSize": 1,
"skew": 0,
"style": {
},
"text": "+",
"width": 0.77778
},
{
"attributes": {
},
"children": [
],
"classes": [
"mspace"
],
"depth": 0,
"height": 0,
"maxFontSize": 0,
"style": {
"marginRight": "0.2222222222222222em"
}
}
],
"classes": [
"enclosing"
],
"depth": 0.08333,
"height": 0.58333,
"maxFontSize": 1,
"style": {
}
},
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0.19444,
"height": 0.43056,
"italic": 0.03588,
"maxFontSize": 1,
"skew": 0.05556,
"style": {
},
"text": "y",
"width": 0.49028
}
]
`;
exports[`An HTML extension builder should render with trust and strict setting 1`] = `
[
{
"attributes": {
"id": "bar"
},
"children": [
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0,
"height": 0.43056,
"italic": 0,
"maxFontSize": 1,
"skew": 0.02778,
"style": {
},
"text": "x",
"width": 0.57153
}
],
"classes": [
"enclosing"
],
"depth": 0,
"height": 0.43056,
"maxFontSize": 1,
"style": {
}
},
{
"attributes": {
},
"children": [
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0,
"height": 0.43056,
"italic": 0,
"maxFontSize": 1,
"skew": 0.02778,
"style": {
},
"text": "x",
"width": 0.57153
}
],
"classes": [
"enclosing",
"foo"
],
"depth": 0,
"height": 0.43056,
"maxFontSize": 1,
"style": {
}
},
{
"attributes": {
"style": "color: red;"
},
"children": [
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0,
"height": 0.43056,
"italic": 0,
"maxFontSize": 1,
"skew": 0.02778,
"style": {
},
"text": "x",
"width": 0.57153
}
],
"classes": [
"enclosing"
],
"depth": 0,
"height": 0.43056,
"maxFontSize": 1,
"style": {
}
},
{
"attributes": {
"data-bar": "b",
"data-foo": "a"
},
"children": [
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0,
"height": 0.43056,
"italic": 0,
"maxFontSize": 1,
"skew": 0.02778,
"style": {
},
"text": "x",
"width": 0.57153
}
],
"classes": [
"enclosing"
],
"depth": 0,
"height": 0.43056,
"maxFontSize": 1,
"style": {
}
}
]
`;
exports[`An implicit group parser within optional groups should work style commands \\sqrt[\\textstyle 3]{x} 1`] = `
[
{
"type": "sqrt",
"body": {
"type": "ordgroup",
"body": [
{
"type": "mathord",
"mode": "math",
"text": "x"
}
],
"mode": "math"
},
"index": {
"type": "ordgroup",
"body": [
{
"type": "styling",
"body": [
{
"type": "textord",
"mode": "math",
"text": "3"
}
],
"mode": "math",
"style": "text"
}
],
"mode": "math"
},
"mode": "math"
}
]
`;
exports[`An implicit group parser within optional groups should work with \\color: \\sqrt[\\color{red} 3]{x} 1`] = `
[
{
"type": "sqrt",
"body": {
"type": "ordgroup",
"body": [
{
"type": "mathord",
"mode": "math",
"text": "x"
}
],
"mode": "math"
},
"index": {
"type": "ordgroup",
"body": [
{
"type": "color",
"body": [
{
"type": "textord",
"mode": "math",
"text": "3"
}
],
"color": "red",
"mode": "math"
}
],
"mode": "math"
},
"mode": "math"
}
]
`;
exports[`An implicit group parser within optional groups should work with old font functions: \\sqrt[\\tt 3]{x} 1`] = `
[
{
"type": "sqrt",
"body": {
"type": "ordgroup",
"body": [
{
"type": "mathord",
"mode": "math",
"text": "x"
}
],
"mode": "math"
},
"index": {
"type": "ordgroup",
"body": [
{
"type": "font",
"body": {
"type": "ordgroup",
"body": [
{
"type": "textord",
"mode": "math",
"text": "3"
}
],
"mode": "math"
},
"font": "mathtt",
"mode": "math"
}
],
"mode": "math"
},
"mode": "math"
}
]
`;
exports[`An implicit group parser within optional groups should work with sizing commands: \\sqrt[\\small 3]{x} 1`] = `
[
{
"type": "sqrt",
"body": {
"type": "ordgroup",
"body": [
{
"type": "mathord",
"mode": "math",
"text": "x"
}
],
"mode": "math"
},
"index": {
"type": "ordgroup",
"body": [
{
"type": "sizing",
"body": [
{
"type": "textord",
"mode": "math",
"text": "3"
}
],
"mode": "math",
"size": 5
}
],
"mode": "math"
},
"mode": "math"
}
]
`;
exports[`An includegraphics builder should not render without trust setting 1`] = `
[
{
"attributes": {
},
"children": [
{
"classes": [
"mord",
"",
""
],
"depth": 0.25,
"height": 0.75,
"italic": 0,
"maxFontSize": 1,
"skew": 0,
"style": {
"color": "#cc0000"
},
"text": "\\\\includegraphics",
"width": 0.5
}
],
"classes": [
"mord",
"text"
],
"depth": 0.25,
"height": 0.75,
"maxFontSize": 1,
"style": {
"color": "#cc0000"
}
}
]
`;
exports[`An includegraphics builder should render with trust setting 1`] = `
[
{
"alt": "KA logo",
"classes": [
"mord"
],
"depth": 0,
"height": 0.9,
"src": "https://cdn.kastatic.org/images/apple-touch-icon-57x57-precomposed.new.png",
"style": {
"height": "0.9em",
"width": "0.9em"
}
}
]
`;
exports[`Extending katex by new fonts and symbols Add new font class to new extended symbols 1`] = `
۹
۹
۱
۱
`;
exports[`Newlines via \\\\ and \\newline \\\\ causes newline, even after mrel and mop 1`] = `
M
=
a
+
b
c
`;
exports[`href and url commands should allow all protocols when trust option is true 1`] = `
[
{
"type": "href",
"body": [
{
"type": "mathord",
"loc": {
"end": 16,
"lexer": {
"input": "\\\\href{ftp://x}{foo}",
"lastIndex": 19
},
"start": 15
},
"mode": "math",
"text": "f"
},
{
"type": "mathord",
"loc": {
"end": 17,
"lexer": {
"input": "\\\\href{ftp://x}{foo}",
"lastIndex": 19
},
"start": 16
},
"mode": "math",
"text": "o"
},
{
"type": "mathord",
"loc": {
"end": 18,
"lexer": {
"input": "\\\\href{ftp://x}{foo}",
"lastIndex": 19
},
"start": 17
},
"mode": "math",
"text": "o"
}
],
"href": "ftp://x",
"mode": "math"
}
]
`;
exports[`href and url commands should allow explicitly allowed protocols 1`] = `
[
{
"type": "href",
"body": [
{
"type": "mathord",
"loc": {
"end": 16,
"lexer": {
"input": "\\\\href{ftp://x}{foo}",
"lastIndex": 19
},
"start": 15
},
"mode": "math",
"text": "f"
},
{
"type": "mathord",
"loc": {
"end": 17,
"lexer": {
"input": "\\\\href{ftp://x}{foo}",
"lastIndex": 19
},
"start": 16
},
"mode": "math",
"text": "o"
},
{
"type": "mathord",
"loc": {
"end": 18,
"lexer": {
"input": "\\\\href{ftp://x}{foo}",
"lastIndex": 19
},
"start": 17
},
"mode": "math",
"text": "o"
}
],
"href": "ftp://x",
"mode": "math"
}
]
`;
exports[`href and url commands should forbid relative URLs when trust option is false 1`] = `
[
{
"type": "color",
"body": [
{
"type": "text",
"body": [
{
"type": "textord",
"mode": "text",
"text": "\\\\"
},
{
"type": "textord",
"mode": "text",
"text": "h"
},
{
"type": "textord",
"mode": "text",
"text": "r"
},
{
"type": "textord",
"mode": "text",
"text": "e"
},
{
"type": "textord",
"mode": "text",
"text": "f"
}
],
"mode": "math"
}
],
"color": "#cc0000",
"mode": "math"
}
]
`;
exports[`href and url commands should not affect spacing around 1`] = `
[
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0,
"height": 0.43056,
"italic": 0,
"maxFontSize": 1,
"skew": 0,
"style": {
},
"text": "a",
"width": 0.52859
},
{
"attributes": {
},
"children": [
],
"classes": [
"mspace"
],
"depth": 0,
"height": 0,
"maxFontSize": 0,
"style": {
"marginRight": "0.2222222222222222em"
}
},
{
"attributes": {
"href": "http://example.com/"
},
"children": [
{
"classes": [
"mbin"
],
"depth": 0.08333,
"height": 0.58333,
"italic": 0,
"maxFontSize": 1,
"skew": 0,
"style": {
},
"text": "+",
"width": 0.77778
},
{
"attributes": {
},
"children": [
],
"classes": [
"mspace"
],
"depth": 0,
"height": 0,
"maxFontSize": 0,
"style": {
"marginRight": "0.2222222222222222em"
}
},
{
"classes": [
"mord",
"mathdefault"
],
"depth": 0,
"height": 0.69444,
"italic": 0,
"maxFontSize": 1,
"skew": 0,
"style": {
},
"text": "b",
"width": 0.42917
}
],
"classes": [
],
"depth": 0.08333,
"height": 0.69444,
"maxFontSize": 1,
"style": {
}
}
]
`;
exports[`href and url commands should not allow explicitly disallow protocols 1`] = `
[
{
"type": "color",
"body": [
{
"type": "text",
"body": [
{
"type": "textord",
"mode": "text",
"text": "\\\\"
},
{
"type": "textord",
"mode": "text",
"text": "h"
},
{
"type": "textord",
"mode": "text",
"text": "r"
},
{
"type": "textord",
"mode": "text",
"text": "e"
},
{
"type": "textord",
"mode": "text",
"text": "f"
}
],
"mode": "math"
}
],
"color": "#cc0000",
"mode": "math"
}
]
`;