This is motivated by the recent switch to Express 4.
Without this commit, “make serve” will print the following message:
Error: Most middleware (like logger) is no longer bundled
with Express and must be installed separately. Please see
https://github.com/senchalabs/connect#middleware.
This reverts commit 4d2e46e7f6.
Having trailing commans makes diffs easier to read as it avoids modifying a
line just to add a trailing comma if there is another item to add at the end
of a list. There are plans to switch to ES6 notation and to translate that
to ES5 as part of the build process. Since that translation would remove
trailing commas, the IE9 problems that originally motivated the commit
should vanish soon.
All these version ranges include the latest version at the time of this
commit, except for the selenium webdriver. There version 3 is incompatible
with version 2, and switching to a version 3 library appears to require
switching to version 3 docker images as well, which would entail using
different browser versions which in turn would lead to differences for a
large number of screenshots. That doesn't appear warranted at this time.
Summary: The previous commit made the `sed` lines do the same thing on mac and
linux. Unfortunately they didn't actually work. Whoops.
Test Plan:
- Run `./release.sh` a couple times and become horribly confused before
realizing what's going on.
@kevinb
Summary: IE 9 doesn't like trailing commas. When we introduced eslint, we added
a bunch of trailing commas, which makes IE 9 sad.
Test Plan:
- `make lint`
- Visit http://localhost:7936/ using IE 9 on browserstack.
- See that the math loads, and there are no errors in the F12 developer tools.
@kevinb
Experimenting with selenium-webdriver@3.0.1 and Firefox 50.1.0 I observed
screenshots having a height of merely 8 pixels. Presumably the margin or
padding of an otherwise empty document. So in order to get the actual size
of the document area, the screenshotter now loads a document which fills the
entire viewport.
So `\text{Hi}` becomes one <span...>Hi</span>, rather than two
<span...>H</span><span...>i</span>.
This allows the font renderer to apply kerning, which changes some
test output.
These commands set their arguments in a given TeX math class. Use
the existing "op" type for \mathop (to support \limits); introduce
a new "mclass" type for the other classes.
Fixes#482. Tests borrowed from #485 (cbreeden).
It's important to get spacing right that the domTree classes reflect
math atom types. So use those types exclusively, rather than
repeating the type mapping twice (once when building spans, once in
getTypeOfGroup).
* Remove getTypeOfGroup.
* Add getTypeOfDomTree (simpler).
* Adjust supsub type calculation.
* Adjust delimsizing internals.
Post-process the list of atoms after they are created, changing
binary operators to ordinary atoms according to the TeXbook's
rules. This makes the `prev` argument redundant, so drop it.
This commit assumes that the math class (mop/mbin/mrel/etc.) comes
first in the `classes` list, if present. Add a TODO to change the
signature of `makeSpan/makeSymbol` to enforce this invariant.
* Internal: Pass full `options` objects to makeSpan/makeSymbol.
Not just the current color. This will facilitate applying options
to built nodes in a standardized way, rather than changing all
callsites.
* Add style switching test: text and scriptstyle in the same group.
* Apply style-specific spacing using different CSS coding.
Specifically, infer style from a class on the *current* element,
rather than the parent element. Use "mtight" class to denote elements
with tight spacing (scriptstyle or scriptscriptstyle). Apply that
class automatically based on options.
* Fix#533, #534, #541.
- #534: Implement getTypeOfGroup for font groups.
- #533, #541: Improve the ways spaces are applied to lists. Since
CSS adjacency implements mathematical spacing, it's incorrect to
introduce "convenience spans" for spaces and display changes into
the generated HTML -- those spans break adjacency. Apply display
changes directly, and shift space spans into adjacent atoms.
Requires updates to two screenshotter tests, LimitControls and
SupSubLeftAlignReset. The new results for these tests are closer
to TeX output than the old results.
Also requires updates to Jasmine tests, since those assumed output
structures that have changed.
* Fix#136: Size commands generate fragments, not spans.
This is so the size commands don't hide the types of their enclosed
atoms. Addresses #136.
This slightly changes the vertical position of the Sizing test. Not
sure the vertical position matters, so change the test.
* Exit cleanly after invalid screenshot test name
This avoids waiting forever.
* Auto-detect host IP in Docker for Mac environment
This checks all available network addresses to find one which the Selenium
container can connect to. That way we don't have to analyze network
settings or similar to figure out the main public IP address of the machine.
* Make server less sensitive to current working directory
That way it becomes possible to run screenshotter.js from within the
Screenshotter directory, and still server all files as intended.
This ensures that running screenshots as indicated by the screenshotter
readme will correctly render the Unicode examples, even if not run on
Travis. It also fixes the commit ID of the unicode fonts.
One alternative would have been using a git submodule. But as many tools
will initialize submodules automatically, that would mean big downloads for
anyone using such a tool to clone KaTeX.
Another alternative would be tweaking the server to fetch the files on
demand if the local copy is unavailable. But that would cause additional
network overhead, so grabbing the files just once should be simpler.