forked from KaTeX/KaTeX
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make ParseNode
value
payload and defineFunction handler functions t…
…ype-safe (KaTeX#1276) * 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.
- Loading branch information
1 parent
3613885
commit 5a4aedd
Showing
18 changed files
with
370 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.