Support math rendering on MFM (#3260)
This commit is contained in:
parent
d2385a0e52
commit
ad84901f39
7 changed files with 75 additions and 0 deletions
|
@ -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([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue