mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 11:48:41 +00:00
* Support \colorbox and \\fcolorbox These are functions from the `color` package. They accept text, not math. They also have padding similar to `\fbox`. Because of the padding, the code in `buildHTML` is intermixed with the `\fbox` code. I have not (yet) created a new file in the functions folder. This way, the reviewer gets a cleaner diff. * Fix lint error * colorbox screenshots * Pick up review comments
176 lines
2.9 KiB
Plaintext
176 lines
2.9 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||
|
||
exports[`A MathML builder should generate <mphantom> nodes for \\phantom 1`] = `
|
||
|
||
<math>
|
||
<semantics>
|
||
<mrow>
|
||
<mphantom>
|
||
<mi>
|
||
x
|
||
</mi>
|
||
</mphantom>
|
||
</mrow>
|
||
<annotation encoding="application/x-tex">
|
||
\\phantom{x}
|
||
</annotation>
|
||
</semantics>
|
||
</math>
|
||
|
||
`;
|
||
|
||
exports[`A MathML builder should generate the right types of nodes 1`] = `
|
||
|
||
<math>
|
||
<semantics>
|
||
<mrow>
|
||
<mi>
|
||
sin
|
||
</mi>
|
||
<mrow>
|
||
<mi>
|
||
x
|
||
</mi>
|
||
</mrow>
|
||
<mo>
|
||
+
|
||
</mo>
|
||
<mn>
|
||
1
|
||
</mn>
|
||
<mspace width="0.277778em">
|
||
</mspace>
|
||
<mtext>
|
||
a
|
||
</mtext>
|
||
</mrow>
|
||
<annotation encoding="application/x-tex">
|
||
\\sin{x}+1\\;\\text{a}
|
||
</annotation>
|
||
</semantics>
|
||
</math>
|
||
|
||
`;
|
||
|
||
exports[`A MathML builder should make prime operators into <mo> nodes 1`] = `
|
||
|
||
<math>
|
||
<semantics>
|
||
<mrow>
|
||
<msup>
|
||
<mi>
|
||
f
|
||
</mi>
|
||
<mo mathvariant="normal">
|
||
′
|
||
</mo>
|
||
</msup>
|
||
</mrow>
|
||
<annotation encoding="application/x-tex">
|
||
f'
|
||
</annotation>
|
||
</semantics>
|
||
</math>
|
||
|
||
`;
|
||
|
||
exports[`A MathML builder should use <menclose> for colorbox 1`] = `
|
||
|
||
<math>
|
||
<semantics>
|
||
<mrow>
|
||
<menclose mathbackground="red">
|
||
<mrow>
|
||
<mtext>
|
||
b
|
||
</mtext>
|
||
</mrow>
|
||
</menclose>
|
||
</mrow>
|
||
<annotation encoding="application/x-tex">
|
||
\\colorbox{red}{b}
|
||
</annotation>
|
||
</semantics>
|
||
</math>
|
||
|
||
`;
|
||
|
||
exports[`A MathML builder should use <mpadded> for raisebox 1`] = `
|
||
|
||
<math>
|
||
<semantics>
|
||
<mrow>
|
||
<mpadded voffset="0.25em">
|
||
<mrow>
|
||
<mtext>
|
||
b
|
||
</mtext>
|
||
</mrow>
|
||
</mpadded>
|
||
</mrow>
|
||
<annotation encoding="application/x-tex">
|
||
\\raisebox{0.25em}{b}
|
||
</annotation>
|
||
</semantics>
|
||
</math>
|
||
|
||
`;
|
||
|
||
exports[`A MathML builder should use <msupsub> for regular operators 1`] = `
|
||
|
||
<math>
|
||
<semantics>
|
||
<mrow>
|
||
<mstyle scriptlevel="0"
|
||
displaystyle="false"
|
||
>
|
||
<msubsup>
|
||
<mo>
|
||
∑
|
||
</mo>
|
||
<mi>
|
||
a
|
||
</mi>
|
||
<mi>
|
||
b
|
||
</mi>
|
||
</msubsup>
|
||
</mstyle>
|
||
</mrow>
|
||
<annotation encoding="application/x-tex">
|
||
\\textstyle\\sum_a^b
|
||
</annotation>
|
||
</semantics>
|
||
</math>
|
||
|
||
`;
|
||
|
||
exports[`A MathML builder should use <munderover> for large operators 1`] = `
|
||
|
||
<math>
|
||
<semantics>
|
||
<mrow>
|
||
<mstyle scriptlevel="0"
|
||
displaystyle="true"
|
||
>
|
||
<munderover>
|
||
<mo>
|
||
∑
|
||
</mo>
|
||
<mi>
|
||
a
|
||
</mi>
|
||
<mi>
|
||
b
|
||
</mi>
|
||
</munderover>
|
||
</mstyle>
|
||
</mrow>
|
||
<annotation encoding="application/x-tex">
|
||
\\displaystyle\\sum_a^b
|
||
</annotation>
|
||
</semantics>
|
||
</math>
|
||
|
||
`;
|