mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-08 12:38:39 +00:00
Rewrite the parser
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
This commit is contained in:
@@ -207,6 +207,18 @@ describe("A subscript and superscript parser", function() {
|
||||
expect(parseA).toEqual(parseB);
|
||||
});
|
||||
|
||||
it("should not parse x^x^x", function() {
|
||||
expect(function() {
|
||||
parseTree("x^x^x");
|
||||
}).toThrow();
|
||||
});
|
||||
|
||||
it("should not parse x_x_x", function() {
|
||||
expect(function() {
|
||||
parseTruee("x_x_x");
|
||||
}).toThrow();
|
||||
});
|
||||
|
||||
it("should work correctly with {}s", function() {
|
||||
expect(function() {
|
||||
parseTree("x^{2+3}");
|
||||
|
Reference in New Issue
Block a user