diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2019-01-25 23:08:06 +0900 |
|---|---|---|
| committer | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2019-01-25 23:08:06 +0900 |
| commit | 79d2374d8ec1de10740d36309c26d00e5ab44c68 (patch) | |
| tree | b5abfda351f46ce39375f6ed495572a59856e983 /test | |
| parent | Refactor (diff) | |
| download | misskey-79d2374d8ec1de10740d36309c26d00e5ab44c68.tar.gz misskey-79d2374d8ec1de10740d36309c26d00e5ab44c68.tar.bz2 misskey-79d2374d8ec1de10740d36309c26d00e5ab44c68.zip | |
Add multiline math syntax
Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
Diffstat (limited to 'test')
| -rw-r--r-- | test/mfm.ts | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/test/mfm.ts b/test/mfm.ts index a4b4a13973..f850e649a3 100644 --- a/test/mfm.ts +++ b/test/mfm.ts @@ -836,15 +836,26 @@ describe('MFM', () => { }); }); - it('math', () => { + it('mathInline', () => { const fomula = 'x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}'; - const text = `\\(${fomula}\\)`; - const tokens = analyze(text); + const content = `\\(${fomula}\\)`; + const tokens = analyze(content); assert.deepStrictEqual(tokens, [ - leaf('math', { formula: fomula }) + leaf('mathInline', { formula: fomula }) ]); }); + describe('mathBlock', () => { + it('simple', () => { + const fomula = 'x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}'; + const content = `\\[\n${fomula}\n\\]`; + const tokens = analyze(content); + assert.deepStrictEqual(tokens, [ + leaf('mathBlock', { formula: fomula }) + ]); + }); + }); + it('search', () => { const tokens1 = analyze('a b c 検索'); assert.deepStrictEqual(tokens1, [ |