* Support for top-level \newline and \\ in inline math
This was a little tricky because `\\` was defined as an endOfExpression.
Instead made `\\` a termination specific to an array environment.
Outside an array environment, buildHTML handles the `cr` object,
resulting in a `.newline` class. Currently this turns into a
`display: block` (with appropriate vertical spacing) only in inline math,
matching LaTeX.
* Simplify code
* Fix Jest errors
* NewLine screenshot test
* Bug fix: \\ only works at top level of inline
* Add \newline and \cr to test
* Switch test to pmatrix
* Add vertical space test
* Add \\ vs. \newline tests
* Fix flow errors
* Add \cr test
* Add documentation for \\ at top level
* Comment out newRow
* Fix commenting out
* Make ParseNode `value` payload type-safe.
* Make defineFunction handlers aware of ParseNode data types.
* Add `type` to all function definitions to help determine handler return type.
* Added unit test for case caught only in screenshot test and fixed issue.
* Rename some symbol `Group`s to avoid conflicts with `ParseNode` groups.
Symbol `Group`s are also used as `ParseNode` types. However, `ParseNode`s of
these types always contain a raw text token as opposed to any structured
content. These `ParseNode`s are passed as arguments into function handlers to
create more semantical `ParseNode`s with more structure.
Before this change, "accent" and "op" were both symbol `Group`s and `ParseNode`
types. With this change, these two types (the raw accent token `ParseNode`, and
the structured semantical `ParseNode` are separated for better type-safety on
the `ParseNode` payload).
* stretchy: Remove FlowFixMe for a forced typecast that's no longer needed.
* Fix#1212 by supporting `\(...\)` in addition to `$...$` inline math nested inside `\text`. This turned out to be harder than one would think because of the way `$` was being handled specially, while `\(` needed to be handled as a function, which immediately consumed the `\(` token, which meant that the first following token got consumed in text mode instead of math mode (unlike `$` where we could switch the mode before consumption).
* Added new `consumeMode` setting for functions which tells the parser to switch modes just for the consumption of the command token.
* Now that we're working with functions, move all the `$` handling code into `functions/math.js`. Somewhat bizarrely, we can define `$` as a function (nearly identical to `\(`) and it all works (just like we can have single-character macros). This move removed a lot of messy stuff from `Parser.js`: `ParsedDollar`, `ParsedFuncOrArgOrDollar`, `newDollar`, `assertFuncOrArg`, and at least three explicit checks for `if (... === "$")`.
* Moved the `consume()` for the command token from `parseSymbol` to `parseGivenFunction`. This ended up not being strictly necessary, but seems conceptually cleaner.
* Partially address #1027 by setting `consumeMode: "text"` for `\text` commands. As a result, `\text` now instantly switches the mode to `"text"`, so even an unbraced macro argument will properly detect text mode. I added a test for this, which is a slightly weaker form of #1027.
* Make types in defineFunction stricter and prep for porting functions.js to flow.
* Add more explicit types to functions/delimsizing.js.
* Port functions.js to @flow.