`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
* extract accent and accentunder into their own files
* cleanup how we apply custom styles to accentBody wrappers
* address feedback from code review
* fix typo
* define a flow type for a CSS style
* clone 'style' object passed to methods in domTree
* forgot that we don't support object spread yet
* Support more scripts in \text{} environments.
This diff is a follow-up to PR #1060 which added support for Indic scripts.
In order to support Czech, Turkish and Hungarian text (at least) inside
\text{} environments, we need to recognize the Latin Extended A and B
Unicode blocks. The patch also adds support for Georgian, and enhances
support for Cyrillic by defining the entire Cyrillic unicode block instead
of defining symbols for a subset of Cyrillic letters as we did previously.
* Only return fontMetrics for supported Unicode scripts in text mode
The Unicode scripts listed in unicodeScripts.js are supported in text mode
but getCharacterMetrics() was returning fake metrics for them even in
math mode. This caused bad handling of \boldsymbol\imath
* use Mode from types.js
* Create a separate entry point for webpack
Created a webpack entry point for KaTeX, which imports katex.less. As
flow[1] and jest[2] doesn't support CSS modules natively, a separate
entry point is used and it is not flowtyped.
[1] https://gist.github.com/lambdahands/d19e0da96285b749f0ef
[2] https://facebook.github.io/jest/docs/en/webpack.html
* Use webpack to build files
* Made webpack.config.js export valid webpack configuration
* Use:
browserify -> webpack
babelify -> babel-loader
UglifyJS CLI -> UglifyJsPlugin
Less CLI -> less-loader
cleancss -> cssnano in css-loader
build/fonts -> file-loader
* Inline CSS(Less) using style-loader and export them using
ExtractTextPlugin
* Add `watch` npm script calling `webpack --watch`
* Improve local testing(webpack-dev-server)
* Made webpackDevServer export a valid webpack configuration
* Compile Less and inline CSS using less-loader and style-loader
* Instead of copying files serve files from /static and use file-loader
* Remove old server.js and its dependencies
* Use webpack-dev-server in Screenshotter
* Include contrib in webpack-dev-server
+ Moved common configurations to webpack.common.js
* Rename webpackDevServer.js to webpack.dev...
to be consistent, avoid confusion with webpack-dev-server and follow
webpack configuration naming convention.
* Remove unnecessary conditional output.path
* Use map instead of reduce
+ Add comments regarding function arguments
* Remove unnecessary mkdir and clean build/* before build
* Use katex as external dependency instead of global variable in contrib
Fixes#692.
* Unblock codes as they are built as a module
* Update package-lock.json
* Add comments regarding devServer option
* Lint renamed webpack.dev.js
a0d8b33
* Export ES6 module and expose its default export
* Revert "Browserify hotfix (#1057)"
This reverts commit f6b509123b.
* Enables colors on the console when running the dev server in Screenshotter
* Add context to webpack configuration
Allows webpack to be run from other directories
* Move `rm -rf build/*` to npm scripts
* Check dependencies before build
* Move UglifyJsPlugin into config creation
* Let webpack handle ES6 modules
Do not transform modules to commonjs in Babel. However Jest doesn't not
support ES6 modules, so transfrom modules to commonjs when NODE_ENV is
`test`.
* Add documentation on testing in IE 9 and 10 using webpack-dev-server
Changed version range to include IE-compatible version