test: add especial symbols to mi tag implementation
This commit is contained in:
parent
83dc582946
commit
65e1d0985c
|
@ -21,13 +21,35 @@ describe('#convert', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('given math string with mi tag with space on it', () => {
|
describe('given math string with mi tag', () => {
|
||||||
test('should trim empty space', () => {
|
describe('tag with space on it', () => {
|
||||||
const mathml = '<root><math><mi> a </mi></math></root>';
|
test('should trim empty space', () => {
|
||||||
|
const mathml = '<root><math><mi> a </mi></math></root>';
|
||||||
|
|
||||||
const result = MathMLToLaTeX.convert(mathml);
|
const result = MathMLToLaTeX.convert(mathml);
|
||||||
|
|
||||||
expect(result).toBe('a');
|
expect(result).toBe('a');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('with especial operator', () => {
|
||||||
|
test('should convert to latex command', () => {
|
||||||
|
const mathml = '<root><math><mi> ∞ </mi></math></root>';
|
||||||
|
|
||||||
|
const result = MathMLToLaTeX.convert(mathml);
|
||||||
|
|
||||||
|
expect(result).toBe('\\infty');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('with empty space', () => {
|
||||||
|
test('should keep empty space and convert to mathrm command', () => {
|
||||||
|
const mathml = '<root><math><mi> </mi></math></root>';
|
||||||
|
|
||||||
|
const result = MathMLToLaTeX.convert(mathml);
|
||||||
|
|
||||||
|
expect(result).toBe('\\textrm{ }');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue