Support math rendering on MFM (#3260)

This commit is contained in:
Aya Morisawa 2018-11-16 17:03:52 +09:00 committed by syuilo
parent d2385a0e52
commit ad84901f39
7 changed files with 75 additions and 0 deletions

View file

@ -210,6 +210,15 @@ describe('Text', () => {
assert.equal(tokens[0].content, '`var x = "Strawberry Pasta";`');
});
it('math', () => {
const fomula = 'x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.';
const text = `$${fomula}$`;
const tokens = analyze(text);
assert.deepEqual([
{ type: 'math', content: text, formula: fomula }
], tokens);
});
it('search', () => {
const tokens1 = analyze('a b c 検索');
assert.deepEqual([