mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-08 12:38:39 +00:00
Add color support
Summary: Not true `\color`, but `\blue`, `\red`, etc. Test Plan: Add `\blue`, etc around stuff, see that it makes pretty colors appear. Reviewers: spicyj Reviewed By: spicyj Differential Revision: http://phabricator.benalpert.com/D44
This commit is contained in:
18
parser.jison
18
parser.jison
@@ -48,12 +48,26 @@ func
|
||||
{$$ = [{type: 'bin', value: yytext}];}
|
||||
| 'div'
|
||||
{$$ = [{type: 'bin', value: yytext}];}
|
||||
| 'dfrac' group group
|
||||
{$$ = [{type: 'dfrac', value: {numer: $2, denom: $3}}];}
|
||||
| 'lvert'
|
||||
{$$ = [{type: 'open', value: yytext}];}
|
||||
| 'rvert'
|
||||
{$$ = [{type: 'close', value: yytext}];}
|
||||
| 'blue' group
|
||||
{$$ = [{type: 'color', value: {color: 'blue', value: $2}}];}
|
||||
| 'orange' group
|
||||
{$$ = [{type: 'color', value: {color: 'orange', value: $2}}];}
|
||||
| 'pink' group
|
||||
{$$ = [{type: 'color', value: {color: 'pink', value: $2}}];}
|
||||
| 'red' group
|
||||
{$$ = [{type: 'color', value: {color: 'red', value: $2}}];}
|
||||
| 'green' group
|
||||
{$$ = [{type: 'color', value: {color: 'green', value: $2}}];}
|
||||
| 'gray' group
|
||||
{$$ = [{type: 'color', value: {color: 'gray', value: $2}}];}
|
||||
| 'purple' group
|
||||
{$$ = [{type: 'color', value: {color: 'purple', value: $2}}];}
|
||||
| 'dfrac' group group
|
||||
{$$ = [{type: 'dfrac', value: {numer: $2, denom: $3}}];}
|
||||
;
|
||||
|
||||
atom
|
||||
|
Reference in New Issue
Block a user