* Fix \nobreakspace, refactor "regular space" checking
Fix#1199 by adding \nobreakspace to the list of commands/symbols that
behave like a regular space character. Refactor to put that list in one
place, and use an object so it checks instantly instead of sequentially.
* Copy test from #1201
* Work around negative space bug in Chrome
Fix#984
The screenshot test is still somewhat defective, showing a space before
the "post" text (a period). This seems limited to the screenshotter, however,
as it works fine in the tester via
http://localhost:7936/?text=%5Cfbox%7B%5C%241%2C%5C!000%2C%5C!000%7D%5CKaTeX&display=0&after=.
* Update screenshots
* Switch to inherited `width: min-content`
* Add CircleCI config for online screenshot verification/generation
* Remove `Checkout unicode fonts` step
Unicode-fonts are now a submodule, which is checked out in `Checkout submodule` step.
* Always generate new screenshots
`makeVList` sets depth with an empty span for which it defines a height. But Chrome, in contenteditable mode only, treats that span as if it contains some text. The resulting `min-height` can over ride our desired depth.
So we insert an empty span inside the `depthStrut` span.
* unicodeTextInMathMode setting
* When `unicodeTextInMathMode` is `true`, accented letters from
`unicodeSymbols.js`, and CJK and other supported languages,
get added support in math mode (as requested in #895).
* When `unicodeTextInMathMode` is `false, all of these stop working in
math mode, and are only supported in text mode (matching XeTeX behavior).
Note that this is a backwards incompatibility with some 0.9.0 alpha/betas.
* Fix handling of Unicode characters ð, Å, å
* Fix double handling of ð (math maps to \eth, not special Unicode character)
* Remove Åå special math handling, thanks to #1125
* Forbid extraLatin when unicodeTextInMathMode is false
* Padding over \sqrt and Paths for frac-line
This replaces two earlier PRs.
* Restore reaction arrows
* regenerate screenshots
* Set line padding in a constant
* Update with latest master
* Fix lint error
* update screenshots
* Remove dummy spans for spacing around \href
Spacing around \href is handled in the `buildHTML`
* Make bin cancellation aware of children of fragment and anchor
+ Added getOutermostNode function
* Fix tight spacing not applied
* Add surrounding argument to html.buildExpression
It is an array consisting type of nodes that will be added to the left
and the right, and if given, will be used to determine bin cancellation
and spacings of outermost nodes.
* Fix html.buildExpression call in leftright
* Add dummy span only when given
* Update buildHTML.js
* Group more test npm scripts into `test:`
* Update documentations on the development workflow
* Update .travis.yml to match updated NPM scripts
* Run npm install in Travis
* Support Reaction Arrows
This PR is written to supply reaction arrows for a future `mhchem` extension. `mhchem` uses seven reaction arrows. Four of them correspond to extensible arrows already available in KaTeX. This PR creates the other three.
These arrows will also be useful to chemists writing about reactions when `mhchem` is unavailable.
Three new extensible arrows are introduced: `\xrightleftarrows`, `\xrightequilibrium`, and `\xleftequilibrium`.
These names are not `mhchem`’s user-facing function names. In `mhchem`, users would call these arrows with syntax such as: `\ce{A<-->B}`, or `\ce{A<=>>B}`, or `\ce{A<<=>B}`. I’ve provided names that look more like the other extensible arrow names. That’s probably worth some discussion.
* generate screenshots for ReactionArrows
* Increase overlap in arrow shaft
To prevent a small gap when rendering in very large font sizes.
* Adjust upper text vert alignment. Add warning.
* Limit alignment adjustment to \xleftequilibrium
* generate screenshots for reaction arrows
* Enable spacing functions in text mode
Spacing functions such as `\;` or `\quad` should be accepted in either math mode or text mode
* Add tests
* Fix tests
* Fix lint error
* Use ES6 in static/main.js
+ Lint static/main.js
* Enable hot module replacement(HMR) in webpack-dev-server
* Disable no-console in static/main.js
* Use seperate entry point/bundle for the test page(/static/main.js)
Fix#1124. \mathring is the math-mode equivalent to the \r accent.
Support follows from a rather trivial symbol aliasing,
plus (for Unicode support) listing it in `unicodeAccents.js`.
webpack-dev-server CLI has a default value of localhost, which only
allows accessing locally. Setting to 0.0.0.0 allows to access the server
from the external. However, the open option will open 0.0.0.0:7936,
which is an invalid address, so it has been removed.
* update fonts and metrics so that accents are positioned correctly
* fix degree symbol, move more accents into the 0x2c0-0x2df range
* fix accents in Unicode screenshots
* update jest snapshots, update AccentsText to include requested characters
* update fonts submodule, add unicode chars to AccentsText test
* update submodules after merging its PR
We want to inherit CSS properties that apply to both text and SVG
but we don't want to inherit styles that affect SVG without affecting text.
This patch adds a screenshot test to verify this.
* Don't inherit SVG style properties from the environment.
We don't want to inherit styles that affect SVG painting unless those
styles also affect regular text rendering. This patch adds styles
to the stylesheet so that every svg element in KaTeX output starts
off with a known set of basic fill and stroke attributes.
This should resolve issue #1088
* Default to stroke:none for <path> elements
* Use JS for spacing between atoms instead of CSS
Summary:
This is the first step towards creating an intermediate representation
that can be used to generate HTML, SVG, and Canvas commands for rendering.
By generating spans that contain the width of the spaces instead of
relying on CSS sibling rules we'll be able to one day replaces the spans
with intermeidate 'Glue' nodes (in a later PR).
An added benefit of this approach is that is enables us to programmatically
change the values for thinspace, mediumspace, and thickspace which will
allow us to implement the \setlength command.
Test Plan:
- npm test
- dockers/Screenshotter/screenshotter.sh --verify
* fixed failures in BinCancellation, BoldSymbol, and OperatorName
* update screenshots
* don't use current size when determining size of spaces, update more screenshots
* fix spacing in SizingBaseline and StyleSwitching
* actually do the right thing for sizing groups
* fix \not for Chrome and Firefox
* do TODOs
* address feedback from the code review
* fix issue in delimsizing.js
* add TODO to think about a better solution in href.js
* fix typos, simplify href, be honest about paddingLeft for \not