mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 11:18:39 +00:00
* Support \hdashline Support `\hdashline` from package `arydshln`. This PR acts as a complement to PR #1395. Similarly to #1395, the dashed line is rendered as `border-bottom-style: dashed;`. That does not exactly match the `dashsegment` and `dashgap` lengths in `arydshln`, but it does render black lines with sharp edges. * Fixed top line position * Add screenshots * Fix lint error * Fix another lint error * Deleted HLine screenshots * Pick up comments
372 lines
8.4 KiB
Plaintext
372 lines
8.4 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`A begin/end parser should grab \\arraystretch 1`] = `
|
|
[
|
|
{
|
|
"type": "array",
|
|
"mode": "math",
|
|
"value": {
|
|
"type": "array",
|
|
"arraystretch": 1.5,
|
|
"body": [
|
|
[
|
|
{
|
|
"type": "styling",
|
|
"mode": "math",
|
|
"value": {
|
|
"type": "styling",
|
|
"style": "text",
|
|
"value": [
|
|
{
|
|
"type": "ordgroup",
|
|
"mode": "math",
|
|
"value": [
|
|
{
|
|
"type": "mathord",
|
|
"loc": {
|
|
"end": 37,
|
|
"lexer": {
|
|
"input": "\\\\def\\\\arraystretch{1.5}\\\\begin{matrix}a&b\\\\\\\\c&d\\\\end{matrix}",
|
|
"pos": 56
|
|
},
|
|
"start": 36
|
|
},
|
|
"mode": "math",
|
|
"value": "a"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "styling",
|
|
"mode": "math",
|
|
"value": {
|
|
"type": "styling",
|
|
"style": "text",
|
|
"value": [
|
|
{
|
|
"type": "ordgroup",
|
|
"mode": "math",
|
|
"value": [
|
|
{
|
|
"type": "mathord",
|
|
"loc": {
|
|
"end": 39,
|
|
"lexer": {
|
|
"input": "\\\\def\\\\arraystretch{1.5}\\\\begin{matrix}a&b\\\\\\\\c&d\\\\end{matrix}",
|
|
"pos": 56
|
|
},
|
|
"start": 38
|
|
},
|
|
"mode": "math",
|
|
"value": "b"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"type": "styling",
|
|
"mode": "math",
|
|
"value": {
|
|
"type": "styling",
|
|
"style": "text",
|
|
"value": [
|
|
{
|
|
"type": "ordgroup",
|
|
"mode": "math",
|
|
"value": [
|
|
{
|
|
"type": "mathord",
|
|
"loc": {
|
|
"end": 42,
|
|
"lexer": {
|
|
"input": "\\\\def\\\\arraystretch{1.5}\\\\begin{matrix}a&b\\\\\\\\c&d\\\\end{matrix}",
|
|
"pos": 56
|
|
},
|
|
"start": 41
|
|
},
|
|
"mode": "math",
|
|
"value": "c"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "styling",
|
|
"mode": "math",
|
|
"value": {
|
|
"type": "styling",
|
|
"style": "text",
|
|
"value": [
|
|
{
|
|
"type": "ordgroup",
|
|
"mode": "math",
|
|
"value": [
|
|
{
|
|
"type": "mathord",
|
|
"loc": {
|
|
"end": 44,
|
|
"lexer": {
|
|
"input": "\\\\def\\\\arraystretch{1.5}\\\\begin{matrix}a&b\\\\\\\\c&d\\\\end{matrix}",
|
|
"pos": 56
|
|
},
|
|
"start": 43
|
|
},
|
|
"mode": "math",
|
|
"value": "d"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
],
|
|
"hLinesBeforeRow": [
|
|
[
|
|
],
|
|
[
|
|
],
|
|
[
|
|
]
|
|
],
|
|
"hskipBeforeAndAfter": false,
|
|
"rowGaps": [
|
|
null
|
|
]
|
|
}
|
|
}
|
|
]
|
|
`;
|
|
|
|
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": {
|
|
},
|
|
"value": "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`] = `
|
|
|
|
<span class="katex-error"
|
|
title="ParseError: KaTeX parse error: Expected group after '^' at position 2: 2^̲&"<>"
|
|
style="color:#933"
|
|
>
|
|
2^&"<>
|
|
</span>
|
|
|
|
`;
|
|
|
|
exports[`An implicit group parser within optional groups should work style commands \\sqrt[\\textstyle 3]{x} 1`] = `
|
|
[
|
|
{
|
|
"type": "sqrt",
|
|
"mode": "math",
|
|
"value": {
|
|
"type": "sqrt",
|
|
"body": {
|
|
"type": "ordgroup",
|
|
"mode": "math",
|
|
"value": [
|
|
{
|
|
"type": "mathord",
|
|
"mode": "math",
|
|
"value": "x"
|
|
}
|
|
]
|
|
},
|
|
"index": {
|
|
"type": "ordgroup",
|
|
"mode": "math",
|
|
"value": [
|
|
{
|
|
"type": "styling",
|
|
"mode": "math",
|
|
"value": {
|
|
"type": "styling",
|
|
"style": "text",
|
|
"value": [
|
|
{
|
|
"type": "textord",
|
|
"mode": "math",
|
|
"value": "3"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
`;
|
|
|
|
exports[`An implicit group parser within optional groups should work with \\color: \\sqrt[\\color{red} 3]{x} 1`] = `
|
|
[
|
|
{
|
|
"type": "sqrt",
|
|
"mode": "math",
|
|
"value": {
|
|
"type": "sqrt",
|
|
"body": {
|
|
"type": "ordgroup",
|
|
"mode": "math",
|
|
"value": [
|
|
{
|
|
"type": "mathord",
|
|
"mode": "math",
|
|
"value": "x"
|
|
}
|
|
]
|
|
},
|
|
"index": {
|
|
"type": "ordgroup",
|
|
"mode": "math",
|
|
"value": [
|
|
{
|
|
"type": "color",
|
|
"mode": "math",
|
|
"value": {
|
|
"type": "color",
|
|
"color": "red",
|
|
"value": [
|
|
{
|
|
"type": "textord",
|
|
"mode": "math",
|
|
"value": "3"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
`;
|
|
|
|
exports[`An implicit group parser within optional groups should work with old font functions: \\sqrt[\\tt 3]{x} 1`] = `
|
|
[
|
|
{
|
|
"type": "sqrt",
|
|
"mode": "math",
|
|
"value": {
|
|
"type": "sqrt",
|
|
"body": {
|
|
"type": "ordgroup",
|
|
"mode": "math",
|
|
"value": [
|
|
{
|
|
"type": "mathord",
|
|
"mode": "math",
|
|
"value": "x"
|
|
}
|
|
]
|
|
},
|
|
"index": {
|
|
"type": "ordgroup",
|
|
"mode": "math",
|
|
"value": [
|
|
{
|
|
"type": "font",
|
|
"mode": "math",
|
|
"value": {
|
|
"type": "font",
|
|
"body": {
|
|
"type": "ordgroup",
|
|
"mode": "math",
|
|
"value": [
|
|
{
|
|
"type": "textord",
|
|
"mode": "math",
|
|
"value": "3"
|
|
}
|
|
]
|
|
},
|
|
"font": "mathtt"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
`;
|
|
|
|
exports[`An implicit group parser within optional groups should work with sizing commands: \\sqrt[\\small 3]{x} 1`] = `
|
|
[
|
|
{
|
|
"type": "sqrt",
|
|
"mode": "math",
|
|
"value": {
|
|
"type": "sqrt",
|
|
"body": {
|
|
"type": "ordgroup",
|
|
"mode": "math",
|
|
"value": [
|
|
{
|
|
"type": "mathord",
|
|
"mode": "math",
|
|
"value": "x"
|
|
}
|
|
]
|
|
},
|
|
"index": {
|
|
"type": "ordgroup",
|
|
"mode": "math",
|
|
"value": [
|
|
{
|
|
"type": "sizing",
|
|
"mode": "math",
|
|
"value": {
|
|
"type": "sizing",
|
|
"size": 5,
|
|
"value": [
|
|
{
|
|
"type": "textord",
|
|
"mode": "math",
|
|
"value": "3"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
`;
|