Add \pm, \div

Reviewers: xymostech

Reviewed By: xymostech

Differential Revision: http://phabricator.benalpert.com/D36
This commit is contained in:
Ben Alpert 2013-07-05 21:44:17 -07:00
parent 29949b500a
commit 97dc1bf1da
2 changed files with 13 additions and 5 deletions

View File

@ -62,11 +62,13 @@ var MJLite = (function() {
};
var charLookup = {
'*': '\u2217',
'-': '\u2212',
'cdot': '\u22C5',
'lvert': '|',
'rvert': '|'
"*": "\u2217",
"-": "\u2212",
"cdot": "\u22C5",
"lvert": "|",
"rvert": "|",
"pm": "\u00b1",
"div": "\u00f7"
};
var textit = function(value) {

View File

@ -9,6 +9,8 @@ cdot return 'CDOT'
frac return 'FRAC'
lvert return 'LVERT'
rvert return 'RVERT'
pm return 'PM'
div return 'DIV'
[/|a-zA-Z0-9] return 'ORD'
[*+-] return 'BIN'
\^ return '^'
@ -66,6 +68,10 @@ group
func
: 'CDOT'
{$$ = [{type: 'bin', value: yytext}];}
| 'PM'
{$$ = [{type: 'bin', value: yytext}];}
| 'DIV'
{$$ = [{type: 'bin', value: yytext}];}
| 'FRAC' group group
{$$ = [{type: 'frac', value: {numer: $2, denom: $3}}];}
| 'LVERT'