Summary:
Add correct parsing of optional arguments. Now, things like `\rule` can shift
based on its argument, and parsing of `\sqrt[3]{x}` fails (correctly) because we
don't support that yet.
Also, cleaned up the lexing code a bit. There was a vestige of the old types in
the lexer (they have now been completely moved to symbols.js). As a byproduct,
this made it hard to call `expect("]")`, because it would look at the type of
the Token and the type for "]" was "close". Now, all functions just look at the
text of the parsed token, and in special occasions (like in the dimension lexer)
it can return some data along with it.
Test Plan:
- Make sure tests still work, and new tests work
- Make sure no huxley screenshots changed
- Make EXTRA SURE `\sqrt[3]{x}` fails.
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D13505
Test Plan: Searched for `[^\x00-\x7f]` in vim and had no results, where there were before.
Reviewers: emily
Reviewed By: emily
Differential Revision: http://phabricator.khanacademy.org/D13459
Contrary to other web font formats, the new WOFF 2.0 Web Font compression format is optimized for file size, memory usage, and decompression speed.
WOFF2 has been supported in Chrome and Opera for a while now. See https://dev.opera.com/blog/opera-23/ for more info.
changed stopType (string) parameter to breakOnInfix (boolean)
renamed rewriteInfixNodes to handleInfixNodes
added a test for {1 \over 2} \over 3, fixed some grammar, and added code in the parser to squash superfluous ordgroups
removed squashOrdGroups and instead don't create an "ordgroup" if one already exists
removed unnecessary variable
moved variable declarations out of "if" statements
removed comment
Fixed style issue with where variables are declared and remove unnecessary comment from functions.js
Summary:
Create a fonts.less file which generates identical css to fonts.css, but using
less rules to be more understandable and customizable. For example, add the
ability to change where the fonts directory is located (instead of mandating it
be located next to the less file), and add the ability to disable specific font
formats (like disable EOTs when IE8 support isn't needed).
Test Plan:
- Ensure that the test page and huxley page still work
- Ensure that the output of `./node_modules/.bin/lessc static/fonts.less` is
the same as the original css by running both through
`./node_modules/.bin/cleancss` and diffing them.
- Ensure that the huxley screenshots haven't changed
- Ensure that the build step still works
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D13326
Update huxley, and then use the Dockerfile to create new huxley screenshots.
Test plan:
- Make sure generating new huxley screenshots works
- Ensure that re-generating huxley screenshots produces no changes
Auditors: alpert
Summary: This makes typing into the box bearable with break-on-exception enabled.
Test Plan: Typed into box; I didn't blow up.
Reviewers: emily
Reviewed By: emily
Subscribers: jessie
Differential Revision: http://phabricator.khanacademy.org/D13314
Summary:
KaTeX doesn't work correctly in quirks mode. Warn in the console and disable
rendering if that happens.
Test Plan:
- Make sure the test still loads and renders math
- Make sure a warning is thrown when the doctype is removed, and no more math
is rendered
- Make sure the tests pass both on the web and with `make test`
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D13192
Summary:
Add the ability to base the metrics for a TTF character on the metrics
from one of the TFM characters.
Test Plan:
- Make sure the tests still work
- Make sure huxley tests didn't change
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D13217
Summary:
Add the dockerfile that I've been using to make huxley screenshots so
others can test their changes by making huxley screenshots. Include a readme
about how to use it correctly.
Test Plan: - Use the dockerfile by running the given commands, see it works
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D12773
Summary:
Improve the build process by combining the CSS files, automatically
selecting font files to include, and building .tar.gz and .zip files.
Test Plan:
- Make sure tests work
- Make sure huxley screenshots didn't change
- Make sure zip and tar.gz files contain only files we want to distribute
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D13159
Summary:
Add comments everywhere! Also fix some small bugs like using Style.id
instead of Style.size, and rename some variables to be more descriptive.
Fixes#22
Test Plan:
- Make sure the huxley screenshots didn't change
- Make sure the tests still pass
Reviewers: alpert
Reviewed By: alpert
Differential Revision: http://phabricator.khanacademy.org/D13158