1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-28 06:48:32 +09:00

Change math syntax (#3280)

This commit is contained in:
Aya Morisawa 2018-11-17 00:31:49 +09:00 committed by syuilo
parent cb0874f15a
commit 3fc70996e2
2 changed files with 8 additions and 8 deletions

View File

@ -9,7 +9,7 @@ export type TextElementMath = {
};
export default function(text: string) {
const match = text.match(/^\$(.+?)\$/);
const match = text.match(/^\\\((.+?)\\\)/);
if (!match) return null;
const math = match[0];
return {

View File

@ -266,7 +266,7 @@ describe('Text', () => {
it('math', () => {
const fomula = 'x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.';
const text = `$${fomula}$`;
const text = `\\(${fomula}\\)`;
const tokens = analyze(text);
assert.deepEqual([
{ type: 'math', content: text, formula: fomula }