mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 11:48:41 +00:00
Cleanup MathML <mrow>, <mtext>, <mn> (#1338)
* Avoid unnecessary <mrow> wrapping buildMathML gains two helpers: * `makeRow` helper wraps an array of nodes in `<mrow>`, unless the array has length 1, in which case no wrapping is necessary. * `buildExpressionRow` for common case of `makeRow(buildExpression(...))` * Combine adjacent <mtext>s in all cases No more need for `makeTextRow` helper or anything fancy in text MathML handler. * Concatenate <mn>s and decimal point into single <mn> Fix #203 * Fix snapshots
This commit is contained in:
@@ -35,6 +35,10 @@ describe("A MathML builder", function() {
|
||||
expect(getMathML("\\sin{x}+1\\;\\text{a}")).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should concatenate digits into single <mn>', () => {
|
||||
expect(getMathML("\\sin{\\alpha}=0.34")).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should make prime operators into <mo> nodes', () => {
|
||||
expect(getMathML("f'")).toMatchSnapshot();
|
||||
});
|
||||
|
Reference in New Issue
Block a user