feat(function): add allowedInArgument instead of greediness property (#2134)

* Remove `greediness` property

Use boolean `grouped` property instead, which is more consistent with 
LaTeX.

BREAKING CHANGE: \cfrac, \color, \textcolor, \colorbox, \fcolorbox are 
no longer grouped.

* Rename grouped to allowedInArgument

* Reenable tests

* Update documentation

* Fix typo

Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
This commit is contained in:
ylemkimon
2020-09-07 13:38:17 +09:00
committed by GitHub
parent 37990cc5b3
commit 5a90558116
10 changed files with 53 additions and 61 deletions

View File

@@ -52,7 +52,6 @@ export type EnvSpec<NODETYPE: NodeType> = {|
type: NODETYPE, // Need to use the type to avoid error. See NOTES below.
numArgs: number,
argTypes?: ArgType[],
greediness: number,
allowedInText: boolean,
numOptionalArgs: number,
handler: EnvHandler,
@@ -99,7 +98,6 @@ export default function defineEnvironment<NODETYPE: NodeType>({
const data = {
type,
numArgs: props.numArgs || 0,
greediness: 1,
allowedInText: false,
numOptionalArgs: 0,
handler,