Make error messages from the lexing and parsing stages be a bit more helpful. If
provided with the input and a position, the error will display the error
position, and the nearby input with the error position underlined (yay combining
marks). Also, standardize the errors a bit (remove doubled "Error:" strings)
Test plan:
- Make sure the errors look totally sweet (before: {F15602}, after: {F15603})
- Trigger every error (that can be triggered) in Parser, Lexer, and buildTree
using the inputs:
`a^`
`a_`
`a^x^x`
`a_x_x`
`\color f`
`\blue `
`\Huge`
`\llap`
`\text`
`\dfrac`
`\dfrac{x}`
`\d`
`\blue{`
`\color{#f`
`{\Huge{x}}`
- See that the tests still work
Auditors: alpert
Summary:
Add real support for the tie symbol. Also, get rid of any of the
leftover bad support
Test Plan:
- See the new normal tests succeed
- See huxley tests didn't change except the new ones, which looks good
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D7772
Summary:
Keep track of the color inside the style now, and use that when we are
rendering things. Added a custom lexing mode to handle lexing colors correctly.
Prefixed the old katex colors (internally) with "katex-" to distinguish them
from CSS colors.
Test Plan:
- Run the normal tests, see they work
- Run the huxley tests, see that they didn't change except for the color one
which looks right
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D7763
Summary:
Make all of the parsing functions keep track of whether they are
parsing in math mode or text mode. Then, add a separate lexing function to lex
text mode, which is different than the normal mode because it does weird things
with spacing and allows a different set of characters.
Test Plan:
- See that the normal tests work
- See that the huxley screenshot looks reasonable
- See that none of the other huxley screenshots changed
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D7578
Summary:
Add some things in to make this more useful to khan-exercises.
Notably, make KaTeX.process create and clean up its own .katex node, and rename
.mathmathmath -> .katex.
Test Plan: Make test, make sure the main page still renders stuff
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D3061
Summary: Allow there to be letters immediately after \ , \;, \,, \:.
Test Plan: Run the tests
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D3031
Summary:
Make our own parser that doesn't use jison, so that we can handle
funny TeX syntax, and to make it smaller.
Test Plan: Make sure the tests pass with the new parser.
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D3029