Socket
Socket
Sign inDemoInstall

katex

Package Overview
Dependencies
Maintainers
6
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

katex - npm Package Compare versions

Comparing version 0.10.0 to 0.10.1

contrib/copy-tex/copy-tex.webpack.js

253

CHANGELOG.md
# Changelog
All notable changes to this project will be documented in this file. This CHANGELOG roughly follows the guidelines from [www.keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
## [v0.10.1]
### Added
- ECMAScript module for contrib (#1624)
- mhchem extension (#1436)
- auto-render: optional pre-process callback (#1784)
- \argmax and \argmin (#1820)
- \textbackslash and \textasciicircum (#1839)
- leqno and fleqn support (#1814)
### Changed
- Include only necessary fonts for target environment specified by Browserslist (#1674)
### Fixed
- Support blackboard bold in text mode (#1757)
- Fix spacings in semisimple groups (#1706)
- Fix parsing comments (#1789)
- Fix \\ and \newline after operator (#1796)
- Fix \hphantom width (#1809)
- Remove double encoding in MathML (#1813)
- Fix Unicode bigcup (#1836)
- Fix \genfrac w/ empty delimiter arguments (#1816)
- \fbox inherits default color (#1847)
- Fix \not and \neq on Chrome 72 (#1852)
## [v0.10.0]

@@ -135,17 +160,17 @@ ### Added

### Added
- Italic Greek capital letters [#1118](https://github.com/Khan/KaTeX/pull/1103)
- Added support for `\mathring` [#1125](https://github.com/Khan/KaTeX/pull/1125)
- Added support for unicode angle brackets, single vertical bar, double vertical bar [#1123](https://github.com/Khan/KaTeX/pull/1123)
- Added support for Reaction Arrows [#1078](https://github.com/Khan/KaTeX/pull/1078)
- Added `\nobreakspace` [#1145](https://github.com/Khan/KaTeX/pull/1145)
- Added support for Unicode colon equals ≔ [#1151](https://github.com/Khan/KaTeX/pull/1151)
- Added support for `\underline` in text mode [#1159](https://github.com/Khan/KaTeX/pull/1159)
- Italic Greek capital letters [#1118](https://github.com/KaTeX/KaTeX/pull/1103)
- Added support for `\mathring` [#1125](https://github.com/KaTeX/KaTeX/pull/1125)
- Added support for unicode angle brackets, single vertical bar, double vertical bar [#1123](https://github.com/KaTeX/KaTeX/pull/1123)
- Added support for Reaction Arrows [#1078](https://github.com/KaTeX/KaTeX/pull/1078)
- Added `\nobreakspace` [#1145](https://github.com/KaTeX/KaTeX/pull/1145)
- Added support for Unicode colon equals ≔ [#1151](https://github.com/KaTeX/KaTeX/pull/1151)
- Added support for `\underline` in text mode [#1159](https://github.com/KaTeX/KaTeX/pull/1159)
### Changed
- Enable spacing functions in text mode [#1139](https://github.com/Khan/KaTeX/pull/1139)
- Enable spacing functions in text mode [#1139](https://github.com/KaTeX/KaTeX/pull/1139)
### Fixed
- Improved JS spacing [#1103](https://github.com/Khan/KaTeX/pull/1103)
- Fixed handling of Unicode characters ð, Å, å [#1157](https://github.com/Khan/KaTeX/pull/1157)
- Padding over `\sqrt` and Paths for frac-line [#1143](https://github.com/Khan/KaTeX/pull/1143)
- Improved JS spacing [#1103](https://github.com/KaTeX/KaTeX/pull/1103)
- Fixed handling of Unicode characters ð, Å, å [#1157](https://github.com/KaTeX/KaTeX/pull/1157)
- Padding over `\sqrt` and Paths for frac-line [#1143](https://github.com/KaTeX/KaTeX/pull/1143)

@@ -155,15 +180,15 @@

### Added
- Added support for `\aa`, `\AA`, `\lq`, `\rq`, `\lbrack`, `\rbrack` [#1069](https://github.com/Khan/KaTeX/pull/1069)
- Added support for more scripts in `\text{}` environments such as Czech, Georgian, Hungarian, Turkish. [#1076](https://github.com/Khan/KaTeX/pull/1076)
- Added support for `\aa`, `\AA`, `\lq`, `\rq`, `\lbrack`, `\rbrack` [#1069](https://github.com/KaTeX/KaTeX/pull/1069)
- Added support for more scripts in `\text{}` environments such as Czech, Georgian, Hungarian, Turkish. [#1076](https://github.com/KaTeX/KaTeX/pull/1076)
- add Main-BoldItalic font to allow nesting of `\textit` and `\textbf`
- Added `\S` and `\P` [#1110](https://github.com/Khan/KaTeX/pull/1110)
- Added `\S` and `\P` [#1110](https://github.com/KaTeX/KaTeX/pull/1110)
### Changed
- Remove symlink to support devs using Windows [#1090](https://github.com/Khan/KaTeX/pull/1090)
- Remove symlink to support devs using Windows [#1090](https://github.com/KaTeX/KaTeX/pull/1090)
### Fixed
- Do not inherit SVG style properties from the environment. [#1089](https://github.com/Khan/KaTeX/pull/1089)
- Update fonts and metrics so that accents are positioned correctly [#1094](https://github.com/Khan/KaTeX/pull/1094)
- Non-portable use of String method `.includes`. Fixed [#1093](https://github.com/Khan/KaTeX/issues/1093)
- Use correct spacing with tight styles. See [#1106](https://github.com/Khan/KaTeX/pull/1106) for more details.
- Do not inherit SVG style properties from the environment. [#1089](https://github.com/KaTeX/KaTeX/pull/1089)
- Update fonts and metrics so that accents are positioned correctly [#1094](https://github.com/KaTeX/KaTeX/pull/1094)
- Non-portable use of String method `.includes`. Fixed [#1093](https://github.com/KaTeX/KaTeX/issues/1093)
- Use correct spacing with tight styles. See [#1106](https://github.com/KaTeX/KaTeX/pull/1106) for more details.

@@ -173,25 +198,25 @@

### Added
- `\kern` fixed and support `\hskip`, `\TeX`, `\LaTeX`, `\KaTeX`. See [#974](https://github.com/Khan/KaTeX/pull/974)
- `\kern` fixed and support `\hskip`, `\TeX`, `\LaTeX`, `\KaTeX`. See [#974](https://github.com/KaTeX/KaTeX/pull/974)
- Supported Unicode middle dot and Unicode accents.
- Added basic support for Indic scripts in addition to CJK. [#1060](https://github.com/Khan/KaTeX/pull/1060)
- Added support for bold italic symbols. [#1011](https://github.com/Khan/KaTeX/pull/1011)
- add `\ae`, `\AE`, `\oe`, `\OE`, `\o`, `\O`, `\ss` with unicode support for those characters in text mode. [#1030](https://github.com/Khan/KaTeX/pull/1030)
- Added `\i` and `\j` for text mode. [#1029](https://github.com/Khan/KaTeX/pull/1029)
- Added `buildHTMLTree`. [#1022](https://github.com/Khan/KaTeX/pull/1022)
- Implemented `\TextOrMath`, @secondoftwo. [#1024](https://github.com/Khan/KaTeX/pull/1024)
- Added a 'common issues' section to the `README.md`. [#1034](https://github.com/Khan/KaTeX/pull/1034)
- Added basic support for Indic scripts in addition to CJK. [#1060](https://github.com/KaTeX/KaTeX/pull/1060)
- Added support for bold italic symbols. [#1011](https://github.com/KaTeX/KaTeX/pull/1011)
- add `\ae`, `\AE`, `\oe`, `\OE`, `\o`, `\O`, `\ss` with unicode support for those characters in text mode. [#1030](https://github.com/KaTeX/KaTeX/pull/1030)
- Added `\i` and `\j` for text mode. [#1029](https://github.com/KaTeX/KaTeX/pull/1029)
- Added `buildHTMLTree`. [#1022](https://github.com/KaTeX/KaTeX/pull/1022)
- Implemented `\TextOrMath`, @secondoftwo. [#1024](https://github.com/KaTeX/KaTeX/pull/1024)
- Added a 'common issues' section to the `README.md`. [#1034](https://github.com/KaTeX/KaTeX/pull/1034)
### Changed
- Made a more working example in README.md. Fixed [#1049](https://github.com/Khan/KaTeX/issues/1049) PR is [#1050](https://github.com/Khan/KaTeX/pull/1050)
- Exposing the build tree. [#1017](https://github.com/Khan/KaTeX/pull/1017)
- Changed `\xLongequal` to `\xlongequal`. [#997](https://github.com/Khan/KaTeX/pull/997)
- Made a more working example in README.md. Fixed [#1049](https://github.com/KaTeX/KaTeX/issues/1049) PR is [#1050](https://github.com/KaTeX/KaTeX/pull/1050)
- Exposing the build tree. [#1017](https://github.com/KaTeX/KaTeX/pull/1017)
- Changed `\xLongequal` to `\xlongequal`. [#997](https://github.com/KaTeX/KaTeX/pull/997)
### Fixed
- Avoid negative space in `\bmod`. [#984](https://github.com/Khan/KaTeX/pull/984)
- Stacking text commands. [#1009](https://github.com/Khan/KaTeX/pull/1009)
- Fixed `\vec` by replacing the combining font glyph with an SVG. [#1018](https://github.com/Khan/KaTeX/pull/1018)
- Made accents zero width. [#1033](https://github.com/Khan/KaTeX/pull/1033)
- Fixed frac-line. [#1025](https://github.com/Khan/KaTeX/pull/1025)
- Implemented correct macros for `liminf` and `limsup`. Fixed [#111](https://github.com/Khan/KaTeX/issues/111)
- `\kern` generates right-margin instead of left-margin. Fixed [#995](https://github.com/Khan/KaTeX/issues/995)
- Avoid negative space in `\bmod`. [#984](https://github.com/KaTeX/KaTeX/pull/984)
- Stacking text commands. [#1009](https://github.com/KaTeX/KaTeX/pull/1009)
- Fixed `\vec` by replacing the combining font glyph with an SVG. [#1018](https://github.com/KaTeX/KaTeX/pull/1018)
- Made accents zero width. [#1033](https://github.com/KaTeX/KaTeX/pull/1033)
- Fixed frac-line. [#1025](https://github.com/KaTeX/KaTeX/pull/1025)
- Implemented correct macros for `liminf` and `limsup`. Fixed [#111](https://github.com/KaTeX/KaTeX/issues/111)
- `\kern` generates right-margin instead of left-margin. Fixed [#995](https://github.com/KaTeX/KaTeX/issues/995)

@@ -202,11 +227,11 @@

- Added Unicode Relations and Unicode Symbol support. Supports Unicode ∴, ∵, `\mid`, Arrows, Big Operators, Binary Operators, Negated Relations.
- Implemented the `alignedat` environment for flexible math spacing. [#930](https://github.com/Khan/KaTeX/pull/930)
- Implemented `\mathchoice` command. [#969](https://github.com/Khan/KaTeX/pull/969)
- Implemented `\href` command. [#923](https://github.com/Khan/KaTeX/pull/923)
- Implemented the `alignedat` environment for flexible math spacing. [#930](https://github.com/KaTeX/KaTeX/pull/930)
- Implemented `\mathchoice` command. [#969](https://github.com/KaTeX/KaTeX/pull/969)
- Implemented `\href` command. [#923](https://github.com/KaTeX/KaTeX/pull/923)
- `\hspace*`, `\@ifstar`, `\@ifnextchar`, `\@firstoftwo` (#975)
- Added `\notni` character `∌`. [#710](https://github.com/Khan/KaTeX/pull/710)
- Added ng-katex link to README.md. [#959](https://github.com/Khan/KaTeX/pull/959)
- Added `\notni` character `∌`. [#710](https://github.com/KaTeX/KaTeX/pull/710)
- Added ng-katex link to README.md. [#959](https://github.com/KaTeX/KaTeX/pull/959)
### Changed
- Single-character macros like active characters. [#973](https://github.com/Khan/KaTeX/pull/973)
- Single-character macros like active characters. [#973](https://github.com/KaTeX/KaTeX/pull/973)
- Re `@flow`:

@@ -216,7 +241,7 @@ - Port buildTree, katex, mathMLTree, parseTree, stretchy to @flow.

### Fixed
- Fixed the spacing between columns in the {aligned} environment. [#942](https://github.com/Khan/KaTeX/pull/942)
- Fixed issue where the {aligned} environment skips the last line if the first column is empty. [#949](https://github.com/Khan/KaTeX/pull/949)
- Appended `ApplyFunction` to math functions in MathML. [#960](https://github.com/Khan/KaTeX/pull/960)
- Changed `\undertilde` to `\utilde`. [#948](https://github.com/Khan/KaTeX/pull/948)
- Changed `frac-line` from border to full span. [#976](https://github.com/Khan/KaTeX/pull/976)
- Fixed the spacing between columns in the {aligned} environment. [#942](https://github.com/KaTeX/KaTeX/pull/942)
- Fixed issue where the {aligned} environment skips the last line if the first column is empty. [#949](https://github.com/KaTeX/KaTeX/pull/949)
- Appended `ApplyFunction` to math functions in MathML. [#960](https://github.com/KaTeX/KaTeX/pull/960)
- Changed `\undertilde` to `\utilde`. [#948](https://github.com/KaTeX/KaTeX/pull/948)
- Changed `frac-line` from border to full span. [#976](https://github.com/KaTeX/KaTeX/pull/976)

@@ -226,10 +251,10 @@

### Changed
- Edited link to Function Support page. [#922](https://github.com/Khan/KaTeX/pull/922)
- Edited link to Function Support page. [#922](https://github.com/KaTeX/KaTeX/pull/922)
- Re `@flow`:
- Exported svgGeometry to @flow. [#936](https://github.com/Khan/KaTeX/pull/936)
- Ported utils to @flow. [#935](https://github.com/Khan/KaTeX/pull/935)
- Exported svgGeometry to @flow. [#936](https://github.com/KaTeX/KaTeX/pull/936)
- Ported utils to @flow. [#935](https://github.com/KaTeX/KaTeX/pull/935)
### Fixed
- Fixed space handling. [#912](https://github.com/Khan/KaTeX/pull/912)
- Prevents disappearing fraction lines. [#931](https://github.com/Khan/KaTeX/pull/931)
- Fixed space handling. [#912](https://github.com/KaTeX/KaTeX/pull/912)
- Prevents disappearing fraction lines. [#931](https://github.com/KaTeX/KaTeX/pull/931)

@@ -239,7 +264,7 @@

### Added
- Added MathJax compatibility script. [#680](https://github.com/Khan/KaTeX/pull/680)
- Added a maxSize option to limit user-specified sizes. [#803](https://github.com/Khan/KaTeX/pull/803)
- Added `\smash`, laps, spaces, and phantoms. [#833](https://github.com/Khan/KaTeX/pull/833)
- Added MathJax compatibility script. [#680](https://github.com/KaTeX/KaTeX/pull/680)
- Added a maxSize option to limit user-specified sizes. [#803](https://github.com/KaTeX/KaTeX/pull/803)
- Added `\smash`, laps, spaces, and phantoms. [#833](https://github.com/KaTeX/KaTeX/pull/833)
- Support for `\raisebox`, `\operatorname`, `\And`, `\colorbox`, `\fcolorbox` and `\verb`.
- Added support for comments. Fixed [#20](https://github.com/Khan/KaTeX/issues/20)
- Added support for comments. Fixed [#20](https://github.com/KaTeX/KaTeX/issues/20)
- To `@flow`:

@@ -249,24 +274,24 @@ - fontMetrics, fontMetricsData, Token, Lexer, MacroExpander, Options, ParseError, ParseNode, Settings, Style.

### Removed
- Removed the positions array computed by Parser's parseArguments(). [#864](https://github.com/Khan/KaTeX/pull/864)
- Removed the positions array computed by Parser's parseArguments(). [#864](https://github.com/KaTeX/KaTeX/pull/864)
### Changed
- Advanced macro support and magic `\dots`. [#794](https://github.com/Khan/KaTeX/pull/794)
- Allow sizing commands inside optional groups. [#885](https://github.com/Khan/KaTeX/pull/885)
- Upgraded `\sqrt` zoom and width. [#890](https://github.com/Khan/KaTeX/pull/890)
- Refactored defineEnvironment to also accept HTML and MathML builders. [#875](https://github.com/Khan/KaTeX/pull/875)
- Advanced macro support and magic `\dots`. [#794](https://github.com/KaTeX/KaTeX/pull/794)
- Allow sizing commands inside optional groups. [#885](https://github.com/KaTeX/KaTeX/pull/885)
- Upgraded `\sqrt` zoom and width. [#890](https://github.com/KaTeX/KaTeX/pull/890)
- Refactored defineEnvironment to also accept HTML and MathML builders. [#875](https://github.com/KaTeX/KaTeX/pull/875)
- For `@flow`:
- Ported environments.js, functions.js, symbol.js, unit.js.
- Separated mandatory and optional arguments in parseArguments. [#903](https://github.com/Khan/KaTeX/pull/903)
- Separated mandatory and optional arguments in parseArguments. [#903](https://github.com/KaTeX/KaTeX/pull/903)
### Breaking Changes
- Require [text]color HTML colors to be well-formed. See [#827](https://github.com/Khan/KaTeX/pull/827)
- Require [text]color HTML colors to be well-formed. See [#827](https://github.com/KaTeX/KaTeX/pull/827)
- `\llap` and `\rlap` now render contents in math mode. Use `\mathllap` (new) and `\mathrlap` (new) if you need the previous behavior.
### Fixed
- Fixed exponential behavior in accent production. [#834](https://github.com/Khan/KaTeX/pull/834)
- Use mpadded for `\raisebox` MathML. [#876](https://github.com/Khan/KaTeX/pull/876)
- Array/Matrix environments do not trim newlines. Fixed [#337](https://github.com/Khan/KaTeX/issues/337). PR is [#479](https://github.com/Khan/KaTeX/pull/479).
- Fixed exponential behavior in accent production. [#834](https://github.com/KaTeX/KaTeX/pull/834)
- Use mpadded for `\raisebox` MathML. [#876](https://github.com/KaTeX/KaTeX/pull/876)
- Array/Matrix environments do not trim newlines. Fixed [#337](https://github.com/KaTeX/KaTeX/issues/337). PR is [#479](https://github.com/KaTeX/KaTeX/pull/479).
- For `@flow`:
- Corrected @flow types. Refactor some Parser code for stricter typing. [#896](https://github.com/Khan/KaTeX/pull/896)
- Fixed match-at flow errors. [#847](https://github.com/Khan/KaTeX/pull/847)
- Corrected @flow types. Refactor some Parser code for stricter typing. [#896](https://github.com/KaTeX/KaTeX/pull/896)
- Fixed match-at flow errors. [#847](https://github.com/KaTeX/KaTeX/pull/847)

@@ -276,13 +301,13 @@

### Added
- Added latin-1 letters as math symbols. See [#796](https://github.com/Khan/KaTeX/pull/796)
- Added support for `\not`. [#140](https://github.com/Khan/KaTeX/pull/140)
- Added latin-1 letters as math symbols. See [#796](https://github.com/KaTeX/KaTeX/pull/796)
- Added support for `\not`. [#140](https://github.com/KaTeX/KaTeX/pull/140)
### Changed
- Support CJK full-width punctuation + Unicode dots. See [#814](https://github.com/Khan/KaTeX/pull/814)
- Support for ```' \` ^ ~ = \u . " \r \H \v``` text-mode accents. See [#802](https://github.com/Khan/KaTeX/pull/802)
- Modernized font creation. See [#624](https://github.com/Khan/KaTeX/pull/624)
- Support CJK full-width punctuation + Unicode dots. See [#814](https://github.com/KaTeX/KaTeX/pull/814)
- Support for ```' \` ^ ~ = \u . " \r \H \v``` text-mode accents. See [#802](https://github.com/KaTeX/KaTeX/pull/802)
- Modernized font creation. See [#624](https://github.com/KaTeX/KaTeX/pull/624)
### Fixed
- Use inline SVG for stretchy elements. [#807](https://github.com/Khan/KaTeX/pull/807)
- Improve `\sqrt`. [#810](https://github.com/Khan/KaTeX/issues/810)
- Use inline SVG for stretchy elements. [#807](https://github.com/KaTeX/KaTeX/pull/807)
- Improve `\sqrt`. [#810](https://github.com/KaTeX/KaTeX/issues/810)

@@ -292,9 +317,9 @@

### Added
- Accepts all existing Greek letters using unicode characters in math mode. See [#410](https://github.com/Khan/KaTeX/pull/410)
- Accepts all existing Greek letters using unicode characters in math mode. See [#410](https://github.com/KaTeX/KaTeX/pull/410)
### Fixed
- Fixed MathML output for ' and large operators with limits. [#788](https://github.com/Khan/KaTeX/pull/788)
- Updated package.json to point 'main' at dist/katex.js. [#791](https://github.com/Khan/KaTeX/pull/791)
- Fixed color support for stretchy, strikethrough, and fbox. [#792](https://github.com/Khan/KaTeX/pull/792)
- Detect attachEvent() support correctly. See [#771](https://github.com/Khan/KaTeX/issues/771) and [#772](https://github.com/Khan/KaTeX/pull/772) for the issue and PR fix respectively.
- Fixed MathML output for ' and large operators with limits. [#788](https://github.com/KaTeX/KaTeX/pull/788)
- Updated package.json to point 'main' at dist/katex.js. [#791](https://github.com/KaTeX/KaTeX/pull/791)
- Fixed color support for stretchy, strikethrough, and fbox. [#792](https://github.com/KaTeX/KaTeX/pull/792)
- Detect attachEvent() support correctly. See [#771](https://github.com/KaTeX/KaTeX/issues/771) and [#772](https://github.com/KaTeX/KaTeX/pull/772) for the issue and PR fix respectively.

@@ -309,43 +334,43 @@ ## [v0.8.1] - 2017-08-11

### Added
- Added some international operators. See [#509](https://github.com/Khan/KaTeX/issues/509)
- Old font command support: `\rm`, `\sf`, `\tt`, `\bf`, `\it`. [#675](https://github.com/Khan/KaTeX/pull/675)
- Builtin macros, macro arguments, `\overset` and `\underset`. [#605](https://github.com/Khan/KaTeX/pull/605)
- Added `\iff`, `\implies`, `\impliedby` support. [#697](https://github.com/Khan/KaTeX/pull/697)
- Support <, >, | and many `\text`... commands in text mode. [#684](https://github.com/Khan/KaTeX/pull/684)
- Implemented $...$ via styling node. [#637](https://github.com/Khan/KaTeX/pull/637)
- Added `\jot` lineskip to aligned environment, switch contents to displaystyle, and add gathered. [#725](https://github.com/Khan/KaTeX/pull/725)
- Support stretchy wide elements. [#670](https://github.com/Khan/KaTeX/pull/670)
- Set maxFontSize on rules. [#744](https://github.com/Khan/KaTeX/pull/744)
- Added some international operators. See [#509](https://github.com/KaTeX/KaTeX/issues/509)
- Old font command support: `\rm`, `\sf`, `\tt`, `\bf`, `\it`. [#675](https://github.com/KaTeX/KaTeX/pull/675)
- Builtin macros, macro arguments, `\overset` and `\underset`. [#605](https://github.com/KaTeX/KaTeX/pull/605)
- Added `\iff`, `\implies`, `\impliedby` support. [#697](https://github.com/KaTeX/KaTeX/pull/697)
- Support <, >, | and many `\text`... commands in text mode. [#684](https://github.com/KaTeX/KaTeX/pull/684)
- Implemented $...$ via styling node. [#637](https://github.com/KaTeX/KaTeX/pull/637)
- Added `\jot` lineskip to aligned environment, switch contents to displaystyle, and add gathered. [#725](https://github.com/KaTeX/KaTeX/pull/725)
- Support stretchy wide elements. [#670](https://github.com/KaTeX/KaTeX/pull/670)
- Set maxFontSize on rules. [#744](https://github.com/KaTeX/KaTeX/pull/744)
### Changes
- Added support for Windows high-contrast mode. Fixed [#716](https://github.com/Khan/KaTeX/issues/716) [#724](https://github.com/Khan/KaTeX/pull/724)
-Implemented `\coloneqq`, `\colonequals`, etc. based on mathtools and colonequals. [#727](https://github.com/Khan/KaTeX/pull/727)
- Added configurable error callback. [#658](https://github.com/Khan/KaTeX/pull/658)
- Added support for absolute TeX units. [#732](https://github.com/Khan/KaTeX/pull/732)
- Revert "Remove trailing commas for IE 9 compatibility". [#622](https://github.com/Khan/KaTeX/pull/622)
- Use utils.deflt for Settings. [#649](https://github.com/Khan/KaTeX/pull/649)
- Refactored and commented space splicing code. [#699](https://github.com/Khan/KaTeX/pull/699)
- Vertically center single-character `\mathop`. [#745](https://github.com/Khan/KaTeX/pull/745)
- Associate font metrics with Options, not Style. [#743](https://github.com/Khan/KaTeX/pull/743)
- Added support for Windows high-contrast mode. Fixed [#716](https://github.com/KaTeX/KaTeX/issues/716) [#724](https://github.com/KaTeX/KaTeX/pull/724)
-Implemented `\coloneqq`, `\colonequals`, etc. based on mathtools and colonequals. [#727](https://github.com/KaTeX/KaTeX/pull/727)
- Added configurable error callback. [#658](https://github.com/KaTeX/KaTeX/pull/658)
- Added support for absolute TeX units. [#732](https://github.com/KaTeX/KaTeX/pull/732)
- Revert "Remove trailing commas for IE 9 compatibility". [#622](https://github.com/KaTeX/KaTeX/pull/622)
- Use utils.deflt for Settings. [#649](https://github.com/KaTeX/KaTeX/pull/649)
- Refactored and commented space splicing code. [#699](https://github.com/KaTeX/KaTeX/pull/699)
- Vertically center single-character `\mathop`. [#745](https://github.com/KaTeX/KaTeX/pull/745)
- Associate font metrics with Options, not Style. [#743](https://github.com/KaTeX/KaTeX/pull/743)
- Upgraded the source to use ES6 syntax including classes, import and static properties.
[#679](https://github.com/Khan/KaTeX/pull/679)
- Use `\displaystyle` within `\over/\underbrace`. [#765](https://github.com/Khan/KaTeX/pull/765)
- Shrinkwrap vlists in table-like CSS. [#768](https://github.com/Khan/KaTeX/pull/768)
- Improve rule coding, including for `\sqrt`. [#776](https://github.com/Khan/KaTeX/pull/776)
[#679](https://github.com/KaTeX/KaTeX/pull/679)
- Use `\displaystyle` within `\over/\underbrace`. [#765](https://github.com/KaTeX/KaTeX/pull/765)
- Shrinkwrap vlists in table-like CSS. [#768](https://github.com/KaTeX/KaTeX/pull/768)
- Improve rule coding, including for `\sqrt`. [#776](https://github.com/KaTeX/KaTeX/pull/776)
### Breaking Changes
- Implicit `\color`, explicitly grouped `\textcolor`. See [#619](https://github.com/Khan/KaTeX/pull/619)
- Implicit `\color`, explicitly grouped `\textcolor`. See [#619](https://github.com/KaTeX/KaTeX/pull/619)
### Fixed
- Fixed high contrast mode better. [#733](https://github.com/Khan/KaTeX/pull/733)
- Fixed all AMS mathord symbols. [#618](https://github.com/Khan/KaTeX/pull/618)
- Fixed x'^2 [#636](https://github.com/Khan/KaTeX/pull/636)
- Fixed font typo math -> main. [#678](https://github.com/Khan/KaTeX/pull/678)
- Fixed spaces before `\middle`. [#689](https://github.com/Khan/KaTeX/pull/689)
- Fixed [#711](https://github.com/Khan/KaTeX/issues/711) issue with multiple superscripts. [#718](https://github.com/Khan/KaTeX/pull/718)
- Fixed interaction between styles and sizes. [#719](https://github.com/Khan/KaTeX/pull/719)
- Correct handling of unbraced kerns followed by spaces. [#751](https://github.com/Khan/KaTeX/pull/751)
- Corrected computation of TeX sizes. [#755](https://github.com/Khan/KaTeX/pull/755)
- Solved Safari rendering issues with font-size overrides. [#780](https://github.com/Khan/KaTeX/pull/780)
- Fixed high contrast mode better. [#733](https://github.com/KaTeX/KaTeX/pull/733)
- Fixed all AMS mathord symbols. [#618](https://github.com/KaTeX/KaTeX/pull/618)
- Fixed x'^2 [#636](https://github.com/KaTeX/KaTeX/pull/636)
- Fixed font typo math -> main. [#678](https://github.com/KaTeX/KaTeX/pull/678)
- Fixed spaces before `\middle`. [#689](https://github.com/KaTeX/KaTeX/pull/689)
- Fixed [#711](https://github.com/KaTeX/KaTeX/issues/711) issue with multiple superscripts. [#718](https://github.com/KaTeX/KaTeX/pull/718)
- Fixed interaction between styles and sizes. [#719](https://github.com/KaTeX/KaTeX/pull/719)
- Correct handling of unbraced kerns followed by spaces. [#751](https://github.com/KaTeX/KaTeX/pull/751)
- Corrected computation of TeX sizes. [#755](https://github.com/KaTeX/KaTeX/pull/755)
- Solved Safari rendering issues with font-size overrides. [#780](https://github.com/KaTeX/KaTeX/pull/780)

@@ -352,0 +377,0 @@

@@ -29,2 +29,6 @@ #!/usr/bin/env node

"on the page on its own line.")
.option("--leqno",
"Render display math in leqno style (left-justified tags).")
.option("--fleqn",
"Render display math flush left.")
.option("-t, --no-throw-on-error",

@@ -31,0 +35,0 @@ "Render errors (in the color given by --error-color) instead of " +

@@ -29,3 +29,3 @@ /* eslint no-console:0 */

const span = document.createElement("span");
const math = data[i].data;
let math = data[i].data;
// Override any display mode defined in the settings with that

@@ -35,2 +35,5 @@ // defined by the text itself

try {
if (optionsCopy.preProcess) {
math = optionsCopy.preProcess(math);
}
katex.render(math, span, optionsCopy);

@@ -37,0 +40,0 @@ } catch (e) {

@@ -7,2 +7,3 @@ /* global beforeEach: false */

import splitAtDelimiters from "../splitAtDelimiters";
import renderMathInElement from "../auto-render";

@@ -238,1 +239,17 @@ beforeEach(function() {

});
describe("Pre-process callback", function() {
it("replace `-squared` with `^2 `", function() {
const el1 = document.createElement('div');
el1.textContent = 'Circle equation: $x-squared + y-squared = r-squared$.';
const el2 = document.createElement('div');
el2.textContent = 'Circle equation: $x^2 + y^2 = r^2$.';
const delimiters = [{left: "$", right: "$", display: false}];
renderMathInElement(el1, {
delimiters,
preProcess: math => math.replace(/-squared/g, '^2'),
});
renderMathInElement(el2, {delimiters});
expect(el1.innerHTML).toEqual(el2.innerHTML);
});
});

@@ -1,2 +0,1 @@

import './copy-tex.css';
import katexReplaceWithTex from './katex2tex';

@@ -3,0 +2,0 @@

@@ -24,4 +24,4 @@ # Copy-tex extension

```html
<link href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/contrib/copy-tex.css" rel="stylesheet" type="text/css">
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/contrib/copy-tex.min.js" integrity="sha384-BU/ZjHp6l8sAdA5pVWg7PDyDWxlvDtRbesZdg6/WprhHmvgodUl4JKPQH/53jvNY" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/copy-tex.css" rel="stylesheet" type="text/css">
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/copy-tex.min.js" integrity="sha384-XhWAe6BtVcvEdS3FFKT7Mcft4HJjPqMQvi5V4YhzH9Qxw497jC13TupOEvjoIPy7" crossorigin="anonymous"></script>
```

@@ -39,2 +39,8 @@

<!-- TODO: uncomment when releasing a new version
ECMAScript module is also available:
```html
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/copy-tex.mjs" integrity="sha384-kS7UtO844uqLwxPmaRwzg1nGbKiHsIteWh+DP2cvT2FtigL0v6w1yPXYKEDzct0C" crossorigin="anonymous"></script>
```` -->
### Known Issues

@@ -41,0 +47,0 @@

@@ -15,6 +15,4 @@ # `math/tex` Custom Script Type Extension

```html
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/contrib/mathtex-script-type.min.js" integrity="sha384-zWYbd0NBwgTsgIdFKVprSfTh1mbMPe5Hz1X3yY4Sd1h/K1cQoUe36OGwAGz/PcDy"></script>
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/mathtex-script-type.min.js" integrity="sha384-LJ2FmexL77rmGm6SIpxq7y+XA6bkLzGZEgCywzKOZG/ws4va9fUVu2neMjvc3zdv"></script>
```
Note that if the URL above contains `...` in-place of a version string, then this script has not yet
been deployed to the CDN.
You can download the script and use it locally, or from a local KaTeX installation instead.

@@ -29,10 +27,16 @@

<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.js" integrity="sha384-2BKqo+exmr9su6dir+qCw08N2ZKRucY4PrGQPPWU1A7FtlCGjmEGFqXCv5nyM5Ij" crossorigin="anonymous"></script>
</head>
<body>
<script type="math/tex">x+\sqrt{1-x^2}</script>
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/contrib/mathtex-script-type.min.js" integrity="sha384-zWYbd0NBwgTsgIdFKVprSfTh1mbMPe5Hz1X3yY4Sd1h/K1cQoUe36OGwAGz/PcDy"></script>
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/mathtex-script-type.min.js" integrity="sha384-LJ2FmexL77rmGm6SIpxq7y+XA6bkLzGZEgCywzKOZG/ws4va9fUVu2neMjvc3zdv"></script>
</body>
</html>
```
<!-- TODO: uncomment when releasing a new version
ECMAScript module is also available:
```html
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/mathtex-script-type.mjs" integrity="sha384-qc7HqE4GHbr2H9R+C8mTSdJmkkZ9E1bkIRyRrxMsoj3dcbGjILzoXJGcBGGns1bk" crossorigin="anonymous"></script>
```` -->

@@ -245,2 +245,6 @@ (function webpackUniversalModuleDefinition(root, factory) {

try {
if (optionsCopy.preProcess) {
math = optionsCopy.preProcess(math);
}
external_katex_default.a.render(math, span, optionsCopy);

@@ -247,0 +251,0 @@ } catch (e) {

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,function(r){return function(r){var n={};function o(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=r,o.c=n,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=1)}([function(e,t){e.exports=r},function(e,t,r){"use strict";r.r(t);var n=r(0),l=r.n(n),s=function(e,t,r){for(var n=r,o=0,a=e.length;n<t.length;){var i=t[n];if(o<=0&&t.slice(n,n+a)===e)return n;"\\"===i?n++:"{"===i?o++:"}"===i&&o--,n++}return-1},d=function(e,t,r,n){for(var o=[],a=0;a<e.length;a++)if("text"===e[a].type){var i=e[a].data,l=!0,d=0,f=void 0;for(-1!==(f=i.indexOf(t))&&(d=f,o.push({type:"text",data:i.slice(0,d)}),l=!1);;){if(l){if(-1===(f=i.indexOf(t,d)))break;o.push({type:"text",data:i.slice(d,f)}),d=f}else{if(-1===(f=s(r,i,d+t.length)))break;o.push({type:"math",data:i.slice(d+t.length,f),rawData:i.slice(d,f+r.length),display:n}),d=f+r.length}l=!l}o.push({type:"text",data:i.slice(d)})}else o.push(e[a]);return o},i=function(e,t){for(var r=function(e,t){for(var r=[{type:"text",data:e}],n=0;n<t.length;n++){var o=t[n];r=d(r,o.left,o.right,o.display||!1)}return r}(e,t.delimiters),n=document.createDocumentFragment(),o=0;o<r.length;o++)if("text"===r[o].type)n.appendChild(document.createTextNode(r[o].data));else{var a=document.createElement("span"),i=r[o].data;t.displayMode=r[o].display;try{l.a.render(i,a,t)}catch(e){if(!(e instanceof l.a.ParseError))throw e;t.errorCallback("KaTeX auto-render: Failed to parse `"+r[o].data+"` with ",e),n.appendChild(document.createTextNode(r[o].rawData));continue}n.appendChild(a)}return n};t.default=function(e,t){if(!e)throw new Error("No element provided to render");var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.delimiters=r.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},function e(t,r){for(var n=0;n<t.childNodes.length;n++){var o=t.childNodes[n];if(3===o.nodeType){var a=i(o.textContent,r);n+=a.childNodes.length-1,t.replaceChild(a,o)}else 1===o.nodeType&&function(){var t=" "+o.className+" ";-1===r.ignoredTags.indexOf(o.nodeName.toLowerCase())&&r.ignoredClasses.every(function(e){return-1===t.indexOf(" "+e+" ")})&&e(o,r)}()}}(e,r)}}]).default});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),a=function(e,t,r){for(var n=r,o=0,a=e.length;n<t.length;){var i=t[n];if(o<=0&&t.slice(n,n+a)===e)return n;"\\"===i?n++:"{"===i?o++:"}"===i&&o--,n++}return-1},i=function(e,t,r,n){for(var o=[],i=0;i<e.length;i++)if("text"===e[i].type){var l=e[i].data,d=!0,s=0,f=void 0;for(-1!==(f=l.indexOf(t))&&(s=f,o.push({type:"text",data:l.slice(0,s)}),d=!1);;){if(d){if(-1===(f=l.indexOf(t,s)))break;o.push({type:"text",data:l.slice(s,f)}),s=f}else{if(-1===(f=a(r,l,s+t.length)))break;o.push({type:"math",data:l.slice(s+t.length,f),rawData:l.slice(s,f+r.length),display:n}),s=f+r.length}d=!d}o.push({type:"text",data:l.slice(s)})}else o.push(e[i]);return o},l=function(e,t){for(var r=function(e,t){for(var r=[{type:"text",data:e}],n=0;n<t.length;n++){var o=t[n];r=i(r,o.left,o.right,o.display||!1)}return r}(e,t.delimiters),n=document.createDocumentFragment(),a=0;a<r.length;a++)if("text"===r[a].type)n.appendChild(document.createTextNode(r[a].data));else{var l=document.createElement("span"),d=r[a].data;t.displayMode=r[a].display;try{t.preProcess&&(d=t.preProcess(d)),o.a.render(d,l,t)}catch(e){if(!(e instanceof o.a.ParseError))throw e;t.errorCallback("KaTeX auto-render: Failed to parse `"+r[a].data+"` with ",e),n.appendChild(document.createTextNode(r[a].rawData));continue}n.appendChild(l)}return n};t.default=function(e,t){if(!e)throw new Error("No element provided to render");var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.delimiters=r.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},function e(t,r){for(var n=0;n<t.childNodes.length;n++){var o=t.childNodes[n];if(3===o.nodeType){var a=l(o.textContent,r);n+=a.childNodes.length-1,t.replaceChild(a,o)}else 1===o.nodeType&&function(){var t=" "+o.className+" ";-1===r.ignoredTags.indexOf(o.nodeName.toLowerCase())&&r.ignoredClasses.every(function(e){return-1===t.indexOf(" "+e+" ")})&&e(o,r)}()}}(e,r)}}]).default});

@@ -94,3 +94,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 2);
/******/ return __webpack_require__(__webpack_require__.s = 1);
/******/ })

@@ -105,4 +105,3 @@ /************************************************************************/

/***/ }),
/* 1 */,
/* 2 */
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

@@ -178,3 +177,2 @@

// CONCATENATED MODULE: ./contrib/copy-tex/copy-tex.js
// Global copy handler to modify behavior on .katex elements.

@@ -208,5 +206,12 @@

});
// CONCATENATED MODULE: ./contrib/copy-tex/copy-tex.webpack.js
/**
* This is the webpack entry point for KaTeX. As ECMAScript doesn't support
* CSS modules natively, a separate entry point is used.
*/
/***/ })
/******/ ])["default"];
});

@@ -1,1 +0,1 @@

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,function(){return function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=2)}([function(e,t,n){},,function(e,t,n){"use strict";n.r(t);n(0);var p={inline:["$","$"],display:["$$","$$"]},l=function(e,t){void 0===t&&(t=p);for(var n=e.querySelectorAll(".katex-mathml + .katex-html"),r=0;r<n.length;r++){var o=n[r];o.remove?o.remove(null):o.parentNode.removeChild(o)}for(var l=e.querySelectorAll(".katex-mathml"),i=0;i<l.length;i++){var a=l[i],u=a.querySelector("annotation");u&&(a.replaceWith?a.replaceWith(u):a.parentNode.replaceChild(u,a),u.innerHTML=t.inline[0]+u.innerHTML+t.inline[1])}for(var f=e.querySelectorAll(".katex-display annotation"),c=0;c<f.length;c++){var d=f[c];d.innerHTML=t.display[0]+d.innerHTML.substr(t.inline[0].length,d.innerHTML.length-t.inline[0].length-t.inline[1].length)+t.display[1]}return e};document.addEventListener("copy",function(e){var t=window.getSelection();if(!t.isCollapsed){var n=t.getRangeAt(0).cloneContents();if(n.querySelector(".katex-mathml")){for(var r=[],o=0;o<n.childNodes.length;o++)r.push(n.childNodes[o].outerHTML);e.clipboardData.setData("text/html",r.join("")),e.clipboardData.setData("text/plain",l(n).textContent),e.preventDefault()}}})}]).default});
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){},function(e,t,n){"use strict";n.r(t);n(0);var r={inline:["$","$"],display:["$$","$$"]},o=function(e,t){void 0===t&&(t=r);for(var n=e.querySelectorAll(".katex-mathml + .katex-html"),o=0;o<n.length;o++){var l=n[o];l.remove?l.remove(null):l.parentNode.removeChild(l)}for(var i=e.querySelectorAll(".katex-mathml"),a=0;a<i.length;a++){var u=i[a],f=u.querySelector("annotation");f&&(u.replaceWith?u.replaceWith(f):u.parentNode.replaceChild(f,u),f.innerHTML=t.inline[0]+f.innerHTML+t.inline[1])}for(var c=e.querySelectorAll(".katex-display annotation"),d=0;d<c.length;d++){var p=c[d];p.innerHTML=t.display[0]+p.innerHTML.substr(t.inline[0].length,p.innerHTML.length-t.inline[0].length-t.inline[1].length)+t.display[1]}return e};document.addEventListener("copy",function(e){var t=window.getSelection();if(!t.isCollapsed){var n=t.getRangeAt(0).cloneContents();if(n.querySelector(".katex-mathml")){for(var r=[],l=0;l<n.childNodes.length;l++)r.push(n.childNodes[l].outerHTML);e.clipboardData.setData("text/html",r.join("")),e.clipboardData.setData("text/plain",o(n).textContent),e.preventDefault()}}})}]).default});

@@ -1,1 +0,1 @@

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],t);else{var r="object"==typeof exports?t(require("katex")):t(e.katex);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,function(r){return function(r){var n={};function o(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=r,o.c=n,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=1)}([function(e,t){e.exports=r},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),u=document.body.getElementsByTagName("script");(u=Array.prototype.slice.call(u)).forEach(function(t){if(!t.type||!t.type.match(/math\/tex/i))return-1;var e=null!=t.type.match(/mode\s*=\s*display(;|\s|\n|$)/),r=document.createElement(e?"div":"span");r.setAttribute("class",e?"equation":"inline-equation");try{o.a.render(t.text,r,{displayMode:e})}catch(e){r.textContent=t.text}t.parentNode.replaceChild(r,t)})}]).default});
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],t);else{var r="object"==typeof exports?t(require("katex")):t(e.katex);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),u=document.body.getElementsByTagName("script");(u=Array.prototype.slice.call(u)).forEach(function(e){if(!e.type||!e.type.match(/math\/tex/i))return-1;var t=null!=e.type.match(/mode\s*=\s*display(;|\s|\n|$)/),r=document.createElement(t?"div":"span");r.setAttribute("class",t?"equation":"inline-equation");try{o.a.render(e.text,r,{displayMode:t})}catch(t){r.textContent=e.text}e.parentNode.replaceChild(r,e)})}]).default});

@@ -1,8 +0,9 @@

# [<img src="https://cdn.rawgit.com/Khan/KaTeX/84189cd3adae24d92e766d14eb80d6e54f3c7dca/katex-logo.svg" width="130" alt="KaTeX">](https://katex.org/)
# [<img src="https://katex.org/img/katex-logo-black.svg" width="130" alt="KaTeX">](https://katex.org/)
[![npm](https://img.shields.io/npm/v/katex.svg)](https://www.npmjs.com/package/katex)
[![CircleCI](https://circleci.com/gh/Khan/KaTeX.svg?style=shield)](https://circleci.com/gh/Khan/KaTeX)
[![codecov](https://codecov.io/gh/Khan/KaTeX/branch/master/graph/badge.svg)](https://codecov.io/gh/Khan/KaTeX)
[![Join the chat at https://gitter.im/Khan/KaTeX](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Khan/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Greenkeeper badge](https://badges.greenkeeper.io/Khan/KaTeX.svg)](https://greenkeeper.io/)
[![CircleCI](https://circleci.com/gh/KaTeX/KaTeX.svg?style=shield)](https://circleci.com/gh/KaTeX/KaTeX)
[![codecov](https://codecov.io/gh/KaTeX/KaTeX/branch/master/graph/badge.svg)](https://codecov.io/gh/KaTeX/KaTeX)
[![Join the chat at https://gitter.im/KaTeX/KaTeX](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/KaTeX/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Greenkeeper badge](https://badges.greenkeeper.io/KaTeX/KaTeX.svg)](https://greenkeeper.io/)
[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/katex/badge?style=rounded)](https://www.jsdelivr.com/package/npm/katex)
![](https://img.badgesize.io/Khan/KaTeX/v0.10.0/dist/katex.min.js?compression=gzip)
![](https://img.badgesize.io/KaTeX/KaTeX/v0.10.1/dist/katex.min.js?compression=gzip)

@@ -12,3 +13,3 @@ KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.

* **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](http://www.intmath.com/cg5/katex-mathjax-comparison.php).
* **Print quality:** KaTeX’s layout is based on Donald Knuth’s TeX, the gold standard for math typesetting.
* **Print quality:** KaTeX's layout is based on Donald Knuth's TeX, the gold standard for math typesetting.
* **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources.

@@ -32,9 +33,9 @@ * **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML.

<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.js" integrity="sha384-2BKqo+exmr9su6dir+qCw08N2ZKRucY4PrGQPPWU1A7FtlCGjmEGFqXCv5nyM5Ij" crossorigin="anonymous"></script>
<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/contrib/auto-render.min.js" integrity="sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe" crossorigin="anonymous"
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>

@@ -46,3 +47,3 @@ </head>

You can also [download KaTeX](https://github.com/khan/katex/releases) and host it yourself.
You can also [download KaTeX](https://github.com/KaTeX/KaTeX/releases) and host it yourself.

@@ -49,0 +50,0 @@ For details on how to configure auto-render extension, refer to [the documentation](https://katex.org/docs/autorender.html).

{
"name": "katex",
"version": "0.10.0",
"version": "0.10.1",
"description": "Fast math typesetting for the web.",
"main": "dist/katex.js",
"homepage": "https://katex.org",
"repository": {
"type": "git",
"url": "git://github.com/Khan/KaTeX.git"
"url": "git://github.com/KaTeX/KaTeX.git"
},

@@ -19,54 +20,56 @@ "files": [

"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/core": "^7.3.3",
"@babel/plugin-proposal-class-properties": "^7.3.3",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-env": "^7.3.1",
"@babel/preset-flow": "^7.0.0",
"@babel/register": "^7.0.0",
"@babel/runtime": "^7.0.0",
"babel-core": "^7.0.0-bridge.0",
"@babel/runtime": "^7.3.1",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.0.1",
"babel-loader": "^8.0.2",
"babel-plugin-istanbul": "^5.0.1",
"babel-jest": "^24.1.0",
"babel-loader": "^8.0.5",
"babel-plugin-istanbul": "^5.1.1",
"babel-plugin-version-inline": "^1.0.0",
"benchmark": "^2.1.4",
"codecov": "^3.0.4",
"css-loader": "^1.0.0",
"cssnano": "^4.0.1",
"eslint": "^5.0.0",
"eslint-plugin-flowtype": "^3.0.0",
"eslint-plugin-react": "^7.10.0",
"browserslist": "^4.4.1",
"caniuse-lite": "^1.0.30000938",
"codecov": "^3.2.0",
"css-loader": "^2.1.0",
"cssnano": "^4.1.10",
"eslint": "^5.14.1",
"eslint-plugin-flowtype": "^3.4.2",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-transform-runtime-aliasing": "^2.0.0",
"file-loader": "^2.0.0",
"flow-bin": "^0.83.0",
"fs-extra": "^7.0.0",
"husky": "^1.0.0-rc.8",
"istanbul-api": "^2.0.5",
"istanbul-lib-coverage": "^2.0.1",
"jest": "^23.5.0",
"jest-serializer-html": "^5.0.0",
"js-yaml": "^3.10.0",
"file-loader": "^3.0.1",
"flow-bin": "^0.93.0",
"fs-extra": "^7.0.1",
"husky": "^1.3.1",
"istanbul-api": "^2.1.1",
"istanbul-lib-coverage": "^2.0.3",
"jest": "^24.1.0",
"jest-serializer-html": "^6.0.0",
"js-yaml": "^3.12.1",
"json-stable-stringify": "^1.0.1",
"jspngopt": "^0.2.0",
"less": "^3.0.4",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"mini-css-extract-plugin": "^0.4.0",
"mini-css-extract-plugin": "^0.5.0",
"mkdirp": "^0.5.1",
"pako": "1.0.6",
"pako": "^1.0.8",
"postcss-loader": "^3.0.0",
"query-string": "^6.2.0",
"rimraf": "^2.6.2",
"rollup": "^0.66.0",
"rollup-plugin-babel": "^4.0.2",
"rimraf": "^2.6.3",
"rollup": "^1.2.2",
"rollup-plugin-alias": "^1.5.1",
"rollup-plugin-babel": "^4.3.2",
"selenium-webdriver": "^3.6.0",
"sri-toolbox": "^0.2.0",
"style-loader": "^0.23.0",
"stylelint": "^9.2.1",
"stylelint-config-standard": "^18.0.0",
"uglifyjs-webpack-plugin": "^2.0.0",
"webpack": "^4.9.1",
"webpack-bundle-analyzer": "^3.0.0",
"webpack-cli": "^3.0.1",
"webpack-dev-server": "^3.1.4"
"style-loader": "^0.23.1",
"stylelint": "^9.10.1",
"stylelint-config-standard": "^18.2.0",
"terser-webpack-plugin": "^1.2.2",
"webpack": "^4.29.5",
"webpack-bundle-analyzer": "^3.0.4",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.2.0"
},

@@ -89,3 +92,3 @@ "bin": "cli.js",

"clean-install": "yarn clean && yarn",
"prestart": "node check-node-version.js && yarn check && node src/unicodeMake.js",
"prestart": "node src/unicodeMake.js",
"start": "webpack-dev-server --hot --config webpack.dev.js",

@@ -99,3 +102,3 @@ "analyze": "webpack --config webpack.analyze.js",

"dependencies": {
"commander": "^2.16.0"
"commander": "^2.19.0"
},

@@ -113,5 +116,8 @@ "husky": {

"contrib/**/*.js",
"!src/unicodeMake.js"
"!src/unicodeMake.js",
"!contrib/mhchem/**"
],
"setupTestFrameworkScriptFile": "<rootDir>/test/setup.js",
"setupFilesAfterEnv": [
"<rootDir>/test/setup.js"
],
"snapshotSerializers": [

@@ -126,4 +132,7 @@ "jest-serializer-html"

"^.+\\.js$": "babel-jest"
},
"moduleNameMapper": {
"^katex$": "<rootDir>/katex.js"
}
}
}

@@ -1,8 +0,9 @@

# [<img src="https://cdn.rawgit.com/Khan/KaTeX/84189cd3adae24d92e766d14eb80d6e54f3c7dca/katex-logo.svg" width="130" alt="KaTeX">](https://katex.org/)
# [<img src="https://katex.org/img/katex-logo-black.svg" width="130" alt="KaTeX">](https://katex.org/)
[![npm](https://img.shields.io/npm/v/katex.svg)](https://www.npmjs.com/package/katex)
[![CircleCI](https://circleci.com/gh/Khan/KaTeX.svg?style=shield)](https://circleci.com/gh/Khan/KaTeX)
[![codecov](https://codecov.io/gh/Khan/KaTeX/branch/master/graph/badge.svg)](https://codecov.io/gh/Khan/KaTeX)
[![Join the chat at https://gitter.im/Khan/KaTeX](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Khan/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Greenkeeper badge](https://badges.greenkeeper.io/Khan/KaTeX.svg)](https://greenkeeper.io/)
[![CircleCI](https://circleci.com/gh/KaTeX/KaTeX.svg?style=shield)](https://circleci.com/gh/KaTeX/KaTeX)
[![codecov](https://codecov.io/gh/KaTeX/KaTeX/branch/master/graph/badge.svg)](https://codecov.io/gh/KaTeX/KaTeX)
[![Join the chat at https://gitter.im/KaTeX/KaTeX](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/KaTeX/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Greenkeeper badge](https://badges.greenkeeper.io/KaTeX/KaTeX.svg)](https://greenkeeper.io/)
[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/katex/badge?style=rounded)](https://www.jsdelivr.com/package/npm/katex)
![](https://img.badgesize.io/Khan/KaTeX/v0.10.0/dist/katex.min.js?compression=gzip)
![](https://img.badgesize.io/KaTeX/KaTeX/v0.10.1/dist/katex.min.js?compression=gzip)

@@ -12,3 +13,3 @@ KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.

* **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](http://www.intmath.com/cg5/katex-mathjax-comparison.php).
* **Print quality:** KaTeX’s layout is based on Donald Knuth’s TeX, the gold standard for math typesetting.
* **Print quality:** KaTeX's layout is based on Donald Knuth's TeX, the gold standard for math typesetting.
* **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources.

@@ -32,9 +33,9 @@ * **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML.

<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.js" integrity="sha384-2BKqo+exmr9su6dir+qCw08N2ZKRucY4PrGQPPWU1A7FtlCGjmEGFqXCv5nyM5Ij" crossorigin="anonymous"></script>
<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/contrib/auto-render.min.js" integrity="sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe" crossorigin="anonymous"
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>

@@ -46,3 +47,3 @@ </head>

You can also [download KaTeX](https://github.com/khan/katex/releases) and host it yourself.
You can also [download KaTeX](https://github.com/KaTeX/KaTeX/releases) and host it yourself.

@@ -49,0 +50,0 @@ For details on how to configure auto-render extension, refer to [the documentation](https://katex.org/docs/autorender.html).

@@ -13,3 +13,3 @@ // @flow

import {Anchor} from "./domTree";
import utils, {assert} from "./utils";
import utils from "./utils";
import {checkNodeType} from "./parseNode";

@@ -29,29 +29,5 @@ import {spacings, tightSpacings} from "./spacingData";

// and the text before Rule 19.
const isBinLeftCanceller = function(
node: ?HtmlDomNode,
isRealGroup: boolean,
): boolean {
// TODO: This code assumes that a node's math class is the first element
// of its `classes` array. A later cleanup should ensure this, for
// instance by changing the signature of `makeSpan`.
if (node) {
return utils.contains(["mbin", "mopen", "mrel", "mop", "mpunct"],
getTypeOfDomTree(node, "right"));
} else {
return isRealGroup;
}
};
const binLeftCanceller = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"];
const binRightCanceller = ["rightmost", "mrel", "mclose", "mpunct"];
const isBinRightCanceller = function(
node: ?HtmlDomNode,
isRealGroup: boolean,
): boolean {
if (node) {
return utils.contains(["mrel", "mclose", "mpunct"],
getTypeOfDomTree(node, "left"));
} else {
return isRealGroup;
}
};
const styleMap = {

@@ -76,3 +52,3 @@ "display": Style.DISPLAY,

};
export type DomType = $Keys<typeof DomEnum>;
type DomType = $Keys<typeof DomEnum>;

@@ -94,3 +70,3 @@ /**

// Parse expressions into `groups`.
const rawGroups: HtmlDomNode[] = [];
const groups: HtmlDomNode[] = [];
for (let i = 0; i < expression.length; i++) {

@@ -100,92 +76,126 @@ const output = buildGroup(expression[i], options);

const children: HtmlDomNode[] = output.children;
rawGroups.push(...children);
groups.push(...children);
} else {
rawGroups.push(output);
groups.push(output);
}
}
// At this point `rawGroups` consists entirely of `symbolNode`s and `span`s.
// Ignore explicit spaces (e.g., \;, \,) when determining what implicit
// spacing should go between atoms of different classes, and add dummy
// spans for determining spacings between surrounding atoms.
const nonSpaces: (?HtmlDomNode)[] = [
surrounding[0] ? makeSpan([surrounding[0]], [], options) : null,
...rawGroups.filter(group => group && group.classes[0] !== "mspace"),
surrounding[1] ? makeSpan([surrounding[1]], [], options) : null,
];
// If `expression` is a partial group, let the parent handle spacings
// to avoid processing groups multiple times.
if (!isRealGroup) {
return groups;
}
// Before determining what spaces to insert, perform bin cancellation.
// Binary operators change to ordinary symbols in some contexts.
for (let i = 1; i < nonSpaces.length - 1; i++) {
const nonSpacesI: HtmlDomNode = assert(nonSpaces[i]);
const left = getOutermostNode(nonSpacesI, "left");
if (left.classes[0] === "mbin" &&
isBinLeftCanceller(nonSpaces[i - 1], isRealGroup)) {
left.classes[0] = "mord";
let glueOptions = options;
if (expression.length === 1) {
const node = checkNodeType(expression[0], "sizing") ||
checkNodeType(expression[0], "styling");
if (!node) {
// No match.
} else if (node.type === "sizing") {
glueOptions = options.havingSize(node.size);
} else if (node.type === "styling") {
glueOptions = options.havingStyle(styleMap[node.style]);
}
const right = getOutermostNode(nonSpacesI, "right");
if (right.classes[0] === "mbin" &&
isBinRightCanceller(nonSpaces[i + 1], isRealGroup)) {
right.classes[0] = "mord";
}
}
const groups = [];
let j = 0;
for (let i = 0; i < rawGroups.length; i++) {
groups.push(rawGroups[i]);
// Dummy spans for determining spacings between surrounding atoms.
// If `expression` has no atoms on the left or right, class "leftmost"
// or "rightmost", respectively, is used to indicate it.
const dummyPrev = makeSpan([surrounding[0] || "leftmost"], [], options);
const dummyNext = makeSpan([surrounding[1] || "rightmost"], [], options);
// For any group that is not a space, get the next non-space. Then
// lookup what implicit space should be placed between those atoms and
// add it to groups.
if (rawGroups[i].classes[0] !== "mspace" && j < nonSpaces.length - 1) {
// if current non-space node is left dummy span, add a glue before
// first real non-space node
if (j === 0) {
groups.pop();
i--;
}
// TODO: These code assumes that a node's math class is the first element
// of its `classes` array. A later cleanup should ensure this, for
// instance by changing the signature of `makeSpan`.
// Get the type of the current non-space node. If it's a document
// fragment, get the type of the rightmost node in the fragment.
const left = getTypeOfDomTree(nonSpaces[j], "right");
// Before determining what spaces to insert, perform bin cancellation.
// Binary operators change to ordinary symbols in some contexts.
traverseNonSpaceNodes(groups, (node, prev) => {
const prevType = prev.classes[0];
const type = node.classes[0];
if (prevType === "mbin" && utils.contains(binRightCanceller, type)) {
prev.classes[0] = "mord";
} else if (type === "mbin" && utils.contains(binLeftCanceller, prevType)) {
node.classes[0] = "mord";
}
}, {node: dummyPrev}, dummyNext);
// Get the type of the next non-space node. If it's a document
// fragment, get the type of the leftmost node in the fragment.
const right = getTypeOfDomTree(nonSpaces[j + 1], "left");
traverseNonSpaceNodes(groups, (node, prev) => {
const prevType = getTypeOfDomTree(prev);
const type = getTypeOfDomTree(node);
// We use buildExpression inside of sizingGroup, but it returns a
// document fragment of elements. sizingGroup sets `isRealGroup`
// to false to avoid processing spans multiple times.
if (left && right && isRealGroup) {
const nonSpacesJp1: HtmlDomNode = assert(nonSpaces[j + 1]);
const space = isLeftTight(nonSpacesJp1)
? tightSpacings[left][right]
: spacings[left][right];
// 'mtight' indicates that the node is script or scriptscript style.
const space = prevType && type ? (node.hasClass("mtight")
? tightSpacings[prevType][type]
: spacings[prevType][type]) : null;
if (space) { // Insert glue (spacing) after the `prev`.
return buildCommon.makeGlue(space, glueOptions);
}
}, {node: dummyPrev}, dummyNext);
if (space) {
let glueOptions = options;
return groups;
};
if (expression.length === 1) {
const node =
checkNodeType(expression[0], "sizing") ||
checkNodeType(expression[0], "styling");
if (!node) {
// No match.
} else if (node.type === "sizing") {
glueOptions = options.havingSize(node.size);
} else if (node.type === "styling") {
glueOptions = options.havingStyle(styleMap[node.style]);
}
}
// Depth-first traverse non-space `nodes`, calling `callback` with the current and
// previous node as arguments, optionally returning a node to insert after the
// previous node. `prev` is an object with the previous node and `insertAfter`
// function to insert after it. `next` is a node that will be added to the right.
// Used for bin cancellation and inserting spacings.
const traverseNonSpaceNodes = function(
nodes: HtmlDomNode[],
callback: (HtmlDomNode, HtmlDomNode) => ?HtmlDomNode,
prev: {|
node: HtmlDomNode,
insertAfter?: HtmlDomNode => void,
|},
next: ?HtmlDomNode,
) {
if (next) { // temporarily append the right node, if exists
nodes.push(next);
}
let i = 0;
for (; i < nodes.length; i++) {
const node = nodes[i];
const partialGroup = checkPartialGroup(node);
if (partialGroup) { // Recursive DFS
traverseNonSpaceNodes(partialGroup.children, callback, prev);
continue;
}
groups.push(buildCommon.makeGlue(space, glueOptions));
}
// Ignore explicit spaces (e.g., \;, \,) when determining what implicit
// spacing should go between atoms of different classes
if (node.classes[0] === "mspace") {
continue;
}
const result = callback(node, prev.node);
if (result) {
if (prev.insertAfter) {
prev.insertAfter(result);
} else { // insert at front
nodes.unshift(result);
i++;
}
j++;
}
prev.node = node;
prev.insertAfter = (index => n => {
nodes.splice(index + 1, 0, n);
i++;
})(i);
}
if (next) {
nodes.pop();
}
};
return groups;
// Check if given node is a partial group, i.e., does not affect spacing around.
const checkPartialGroup = function(
node: HtmlDomNode,
): ?(DocumentFragment<HtmlDomNode> | Anchor) {
if (node instanceof DocumentFragment || node instanceof Anchor) {
return node;
}
return null;
};

@@ -198,5 +208,5 @@

): HtmlDomNode {
if (node instanceof DocumentFragment ||
node instanceof Anchor) {
const children = node.children;
const partialGroup = checkPartialGroup(node);
if (partialGroup) {
const children = partialGroup.children;
if (children.length) {

@@ -206,3 +216,3 @@ if (side === "right") {

} else if (side === "left") {
return getOutermostNode(children[0], "right");
return getOutermostNode(children[0], "left");
}

@@ -215,5 +225,6 @@ }

// Return math atom class (mclass) of a domTree.
// If `side` is given, it will get the type of the outermost node at given side.
export const getTypeOfDomTree = function(
node: ?HtmlDomNode,
side: Side,
side: ?Side,
): ?DomType {

@@ -223,4 +234,5 @@ if (!node) {

}
node = getOutermostNode(node, side);
if (side) {
node = getOutermostNode(node, side);
}
// This makes a lot of assumptions as to where the type of atom

@@ -231,11 +243,2 @@ // appears. We should do a better job of enforcing this.

// If `node` is an atom return whether it's been assigned the mtight class.
// If `node` is a document fragment, return the value of isLeftTight() for the
// leftmost node in the fragment.
// 'mtight' indicates that the node is script or scriptscript style.
export const isLeftTight = function(node: HtmlDomNode): boolean {
node = getOutermostNode(node, "left");
return node.hasClass("mtight");
};
export const makeNullDelimiter = function(

@@ -344,6 +347,7 @@ options: Options,

// Put any post-operator glue on same line as operator.
// Watch for \nobreak along the way.
// Watch for \nobreak along the way, and stop at \newline.
let nobreak = false;
while (i < expression.length - 1 &&
expression[i + 1].hasClass("mspace")) {
expression[i + 1].hasClass("mspace") &&
!expression[i + 1].hasClass("newline")) {
i++;

@@ -350,0 +354,0 @@ parts.push(expression[i]);

@@ -19,2 +19,16 @@ // @flow

const displayWrap = function(node: DomSpan, settings: Settings): DomSpan {
if (settings.displayMode) {
const classes = ["katex-display"];
if (settings.leqno) {
classes.push("leqno");
}
if (settings.fleqn) {
classes.push("fleqn");
}
node = buildCommon.makeSpan(classes, [node]);
}
return node;
};
export const buildTree = function(

@@ -33,7 +47,3 @@ tree: AnyParseNode[],

if (settings.displayMode) {
return buildCommon.makeSpan(["katex-display"], [katexNode]);
} else {
return katexNode;
}
return displayWrap(katexNode, settings);
};

@@ -49,9 +59,5 @@

const katexNode = buildCommon.makeSpan(["katex"], [htmlNode]);
if (settings.displayMode) {
return buildCommon.makeSpan(["katex-display"], [katexNode]);
} else {
return katexNode;
}
return displayWrap(katexNode, settings);
};
export default buildTree;

@@ -187,3 +187,3 @@ // @flow

const inner = html.buildExpression(group.body, options, true,
[null, "mclose"]);
["mopen", "mclose"]);

@@ -190,0 +190,0 @@ let innerHeight = 0;

@@ -102,3 +102,2 @@ // @flow

const {mode} = parser;
parser.consumeSpaces();
const body = parser.parseExpression(true, breakOnTokenText);

@@ -105,0 +104,0 @@ const style = `math${funcName.slice(1)}`;

@@ -366,17 +366,13 @@ // @flow

// Look into the parse nodes to get the desired delimiters.
let leftNode = checkNodeType(args[0], "ordgroup");
let leftNode = checkNodeType(args[0], "atom");
if (leftNode) {
leftNode = assertAtomFamily(leftNode.body[0], "open");
} else {
leftNode = assertAtomFamily(args[0], "open");
}
const leftDelim = delimFromValue(leftNode.text);
const leftDelim = leftNode ? delimFromValue(leftNode.text) : null;
let rightNode = checkNodeType(args[1], "ordgroup");
let rightNode = checkNodeType(args[1], "atom");
if (rightNode) {
rightNode = assertAtomFamily(rightNode.body[0], "close");
} else {
rightNode = assertAtomFamily(args[1], "close");
}
const rightDelim = delimFromValue(rightNode.text);
const rightDelim = rightNode ? delimFromValue(rightNode.text) : null;

@@ -383,0 +379,0 @@ const barNode = assertNodeType(args[2], "size");

@@ -276,3 +276,3 @@ // @flow

"\u22c2": "\\bigcap",
"\u22c3": "\\bigcap",
"\u22c3": "\\bigcup",
"\u2a00": "\\bigodot",

@@ -279,0 +279,0 @@ "\u2a01": "\\bigoplus",

@@ -104,4 +104,3 @@ // @flow

const word = expression.map(node => node.toText()).join("");
// word has already been escaped by `node.toText()`
expression = [new mathMLTree.TextNode(word, false)];
expression = [new mathMLTree.TextNode(word)];
}

@@ -108,0 +107,0 @@

@@ -11,2 +11,6 @@ // @flow

htmlBuilder(group, options) {
if (group.semisimple) {
return buildCommon.makeFragment(
html.buildExpression(group.body, options, false));
}
return buildCommon.makeSpan(

@@ -13,0 +17,0 @@ ["mord"], html.buildExpression(group.body, options, true), options);

@@ -74,3 +74,4 @@ // @flow

return node;
// For spacing, TeX treats \smash as a math group (same spacing as ord).
return buildCommon.makeSpan(["mord"], [node], options);
},

@@ -77,0 +78,0 @@ mathmlBuilder: (group, options) => {

@@ -64,3 +64,2 @@ // @flow

handler: ({breakOnTokenText, funcName, parser}, args) => {
parser.consumeSpaces();
const body = parser.parseExpression(false, breakOnTokenText);

@@ -67,0 +66,0 @@

@@ -58,3 +58,3 @@ // @flow

const node = buildCommon.makeSpan(
["mord"], [html.buildGroup(group.body, options)]);
[], [html.buildGroup(group.body, options)]);

@@ -89,6 +89,9 @@ if (!group.smashHeight && !group.smashDepth) {

return buildCommon.makeVList({
const smashedNode = buildCommon.makeVList({
positionType: "firstBaseline",
children: [{type: "elem", elem: node}],
}, options);
// For spacing, TeX treats \hphantom as a math group (same spacing as ord).
return buildCommon.makeSpan(["mord"], [smashedNode], options);
},

@@ -95,0 +98,0 @@ mathmlBuilder: (group, options) => {

@@ -28,3 +28,2 @@ // @flow

// parse out the implicit body
parser.consumeSpaces();
const body = parser.parseExpression(true, breakOnTokenText);

@@ -31,0 +30,0 @@

@@ -20,2 +20,3 @@ // @flow

import type {LexerInterface} from "./Token";
import type Settings from "./Settings";

@@ -57,17 +58,24 @@ /* The following tokenRegex

// These regexs are for matching results from tokenRegex,
// so they do have ^ markers.
export const controlWordRegex = new RegExp(`^${controlWordRegexString}`);
/** Main Lexer class */
export default class Lexer implements LexerInterface {
input: string;
settings: Settings;
tokenRegex: RegExp;
// category codes, only supports comment characters (14) for now
catcodes: {[string]: number};
constructor(input: string) {
constructor(input: string, settings: Settings) {
// Separate accents from characters
this.input = input;
this.settings = settings;
this.tokenRegex = new RegExp(tokenRegexString, 'g');
this.catcodes = {
"%": 14, // comment character
};
}
setCatcode(char: string, code: number) {
this.catcodes[char] = code;
}
/**

@@ -90,2 +98,15 @@ * This function lexes a single token.

if (this.catcodes[text] === 14) { // comment character
const nlIndex = input.indexOf('\n', this.tokenRegex.lastIndex);
if (nlIndex === -1) {
this.tokenRegex.lastIndex = input.length; // EOF
this.settings.reportNonstrict("commentAtEnd",
"% comment has no terminating newline; LaTeX would " +
"fail because of commenting the end of math mode (e.g. $)");
} else {
this.tokenRegex.lastIndex = nlIndex + 1;
}
return this.lex();
}
// Trim any trailing whitespace from control word match

@@ -92,0 +113,0 @@ const controlMatch = text.match(controlWordWhitespaceRegex);

@@ -53,3 +53,3 @@ // @flow

feed(input: string) {
this.lexer = new Lexer(input);
this.lexer = new Lexer(input, this.settings);
}

@@ -318,3 +318,3 @@

}
const bodyLexer = new Lexer(expansion);
const bodyLexer = new Lexer(expansion, this.settings);
const tokens = [];

@@ -348,2 +348,1 @@ let tok = bodyLexer.lex();

}

@@ -301,4 +301,2 @@ // @flow

defineMacro("\\egroup", "}");
defineMacro("\\begingroup", "{");
defineMacro("\\endgroup", "}");

@@ -327,13 +325,2 @@ // Symbols from latex.ltx:

// Unicode double-struck letters
defineMacro("\u2102", "\\mathbb{C}");
defineMacro("\u210D", "\\mathbb{H}");
defineMacro("\u2115", "\\mathbb{N}");
defineMacro("\u2119", "\\mathbb{P}");
defineMacro("\u211A", "\\mathbb{Q}");
defineMacro("\u211D", "\\mathbb{R}");
defineMacro("\u2124", "\\mathbb{Z}");
defineMacro("\u210E", "\\mathit{h}"); // Planck constant
// Characters omitted from Unicode range 1D400–1D7FF

@@ -894,1 +881,8 @@ defineMacro("\u212C", "\\mathscr{B}"); // script

defineMacro("\\Zeta", "\\mathrm{Z}");
//////////////////////////////////////////////////////////////////////
// statmath.sty
// https://ctan.math.illinois.edu/macros/latex/contrib/statmath/statmath.pdf
defineMacro("\\argmin", "\\DOTSB\\mathop{\\operatorname{arg\\,min}}\\limits");
defineMacro("\\argmax", "\\DOTSB\\mathop{\\operatorname{arg\\,max}}\\limits");

@@ -129,7 +129,5 @@ // @flow

text: string;
needsEscape: boolean;
constructor(text: string, needsEscape: boolean = true) {
constructor(text: string) {
this.text = text;
this.needsEscape = needsEscape;
}

@@ -141,3 +139,3 @@

toNode(): Node {
return document.createTextNode(this.toText());
return document.createTextNode(this.text);
}

@@ -150,11 +148,11 @@

toMarkup(): string {
return this.toText();
return utils.escape(this.toText());
}
/**
* Converts the text node into an escaped string
* Converts the text node into a string
* (representing the text iteself).
*/
toText(): string {
return this.needsEscape ? utils.escape(this.text) : this.text;
return this.text;
}

@@ -177,21 +175,21 @@ }

// See https://www.w3.org/TR/2000/WD-MathML2-20000328/chapter6.html
// for a table of space-like characters. We consistently use the
// &LongNames; because Unicode does not have single characters for
// &ThickSpace; (\u2005\u200a) and all negative spaces.
// for a table of space-like characters. We use Unicode
// representations instead of &LongNames; as it's not clear how to
// make the latter via document.createTextNode.
if (width >= 0.05555 && width <= 0.05556) {
this.character = "&VeryThinSpace;"; // \u200a
this.character = "\u200a"; // &VeryThinSpace;
} else if (width >= 0.1666 && width <= 0.1667) {
this.character = "&ThinSpace;"; // \u2009
this.character = "\u2009"; // &ThinSpace;
} else if (width >= 0.2222 && width <= 0.2223) {
this.character = "&MediumSpace;"; // \u2005
this.character = "\u2005"; // &MediumSpace;
} else if (width >= 0.2777 && width <= 0.2778) {
this.character = "&ThickSpace;"; // \u2005\u200a
this.character = "\u2005\u200a"; // &ThickSpace;
} else if (width >= -0.05556 && width <= -0.05555) {
this.character = "&NegativeVeryThinSpace;";
this.character = "\u200a\u2063"; // &NegativeVeryThinSpace;
} else if (width >= -0.1667 && width <= -0.1666) {
this.character = "&NegativeThinSpace;";
this.character = "\u2009\u2063"; // &NegativeThinSpace;
} else if (width >= -0.2223 && width <= -0.2222) {
this.character = "&NegativeMediumSpace;";
this.character = "\u205f\u2063"; // &NegativeMediumSpace;
} else if (width >= -0.2778 && width <= -0.2777) {
this.character = "&NegativeThickSpace;";
this.character = "\u2005\u2063"; // &NegativeThickSpace;
} else {

@@ -198,0 +196,0 @@ this.character = null;

@@ -82,2 +82,3 @@ // @flow

body: AnyParseNode[],
semisimple?: boolean,
|},

@@ -84,0 +85,0 @@ "raw": {|

@@ -131,4 +131,10 @@ // @flow

static endOfExpression = ["}", "\\end", "\\right", "&"];
static endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"];
static endOfGroup = {
"[": "]",
"{": "}",
"\\begingroup": "\\endgroup",
}
/**

@@ -361,4 +367,2 @@ * Parses an "expression", which is a list of atoms.

superscript = {type: "ordgroup", mode: this.mode, body: primes};
} else if (lex.text === "%") {
this.consumeComment();
} else {

@@ -413,2 +417,7 @@ // If it wasn't ^, _, or ', stop parsing super/subscripts

// hyperref package sets the catcode of % as an active character
if (funcData.argTypes && funcData.argTypes[0] === "url") {
this.gullet.lexer.setCatcode("%", 13);
}
// Consume the command token after possibly switching to the

@@ -527,2 +536,17 @@ // mode specified by the function (for instant mode switching),

return this.parseGroup(name, optional, greediness, undefined, type);
case "raw": {
if (optional && this.nextToken.text === "{") {
return null;
}
const token = this.parseStringGroup("raw", optional, true);
if (token) {
return {
type: "raw",
mode: "text",
string: token.text,
};
} else {
throw new ParseError("Expected raw group", this.nextToken);
}
}
case "original":

@@ -544,23 +568,2 @@ case null:

consumeComment() {
// the newline character is normalized in Lexer, check original source
while (this.nextToken.text !== "EOF" && this.nextToken.loc &&
this.nextToken.loc.getSource().indexOf("\n") === -1) {
this.consume();
}
if (this.nextToken.text === "EOF") {
this.settings.reportNonstrict("commentAtEnd",
"% comment has no terminating newline; LaTeX would " +
"fail because of commenting the end of math mode (e.g. $)");
}
if (this.mode === "math") {
this.consumeSpaces(); // ignore spaces in math mode
} else if (this.nextToken.loc) { // text mode
const source = this.nextToken.loc.getSource();
if (source.indexOf("\n") === source.length - 1) {
this.consumeSpaces(); // if no space after the first newline
}
}
}
/**

@@ -584,2 +587,3 @@ * Parses a group, essentially returning the string formed by the

// allow a single character in raw string group
this.gullet.lexer.setCatcode("%", 14); // reset the catcode of %
this.consume();

@@ -602,8 +606,2 @@ return nextToken;

firstToken.range(lastToken, str));
case "%":
if (!raw) { // allow % in raw string group
this.consumeComment();
continue;
}
break;
case groupBegin:

@@ -621,2 +619,3 @@ nested++;

this.mode = outerMode;
this.gullet.lexer.setCatcode("%", 14); // reset the catcode of %
this.expect(groupEnd);

@@ -640,8 +639,4 @@ return firstToken.range(lastToken, str);

let str = "";
while (this.nextToken.text !== "EOF" && (regex.test(
str + this.nextToken.text) || this.nextToken.text === "%")) {
if (this.nextToken.text === "%") {
this.consumeComment();
continue;
}
while (this.nextToken.text !== "EOF" &&
regex.test(str + this.nextToken.text)) {
lastToken = this.nextToken;

@@ -782,5 +777,7 @@ str += lastToken.text;

let groupEnd;
let result;
// Try to parse an open brace
if (text === (optional ? "[" : "{")) {
// Try to parse an open brace or \begingroup
if (optional ? text === "[" : text === "{" || text === "\\begingroup") {
groupEnd = Parser.endOfGroup[text];
// Start a new group namespace

@@ -790,13 +787,7 @@ this.gullet.beginGroup();

this.consume();
const expression = this.parseExpression(false, optional ? "]" : "}");
const expression = this.parseExpression(false, groupEnd);
const lastToken = this.nextToken;
// Switch mode back before consuming symbol after close brace
if (mode) {
this.switchMode(outerMode);
}
// End group namespace before consuming symbol after close brace
this.gullet.endGroup();
// Make sure we get a close brace
this.expect(optional ? "]" : "}");
return {
result = {
type: "ordgroup",

@@ -806,2 +797,7 @@ mode: this.mode,

body: expression,
// A group formed by \begingroup...\endgroup is a semi-simple group
// which doesn't affect spacing in math mode, i.e., is transparent.
// https://tex.stackexchange.com/questions/1930/when-should-one-
// use-begingroup-instead-of-bgroup
semisimple: text === "\\begingroup" || undefined,
};

@@ -830,2 +826,6 @@ } else if (optional) {

}
// Make sure we got a close brace
if (groupEnd) {
this.expect(groupEnd);
}
return result;

@@ -907,5 +907,2 @@ }

};
} else if (text === "%") {
this.consumeComment();
return this.parseSymbol();
}

@@ -912,0 +909,0 @@ // At this point, we should have a symbol, possibly with accents.

@@ -21,2 +21,4 @@ // @flow

displayMode?: boolean;
leqno?: boolean;
fleqn?: boolean;
throwOnError?: boolean;

@@ -44,2 +46,4 @@ errorColor?: string;

displayMode: boolean;
leqno: boolean;
fleqn: boolean;
throwOnError: boolean;

@@ -58,2 +62,4 @@ errorColor: string;

this.displayMode = utils.deflt(options.displayMode, false);
this.leqno = utils.deflt(options.leqno, false);
this.fleqn = utils.deflt(options.fleqn, false);
this.throwOnError = utils.deflt(options.throwOnError, true);

@@ -60,0 +66,0 @@ this.errorColor = utils.deflt(options.errorColor, "#cc0000");

@@ -20,6 +20,2 @@ // @flow

getSource(): string {
return this.lexer.input.slice(this.start, this.end);
}
/**

@@ -26,0 +22,0 @@ * Merges two `SourceLocation`s from location providers, given they are

@@ -328,3 +328,3 @@ // @flow

c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 241v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,

@@ -331,0 +331,0 @@ // rightarrowabovebar is mostly from glyph U+2192, KaTeX Main

@@ -11,3 +11,3 @@ // @flow

"textord", "mathord", etc).
See https://github.com/Khan/KaTeX/wiki/Examining-TeX#group-types
See https://github.com/KaTeX/KaTeX/wiki/Examining-TeX#group-types
* - replace: the character that this symbol or function should be

@@ -572,3 +572,3 @@ * replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi

defineSymbol(math, main, rel, "\u2208", "\\in", true);
defineSymbol(math, main, rel, "\u0338", "\\@not");
defineSymbol(math, main, rel, "\ue020", "\\@not");
defineSymbol(math, main, rel, "\u2282", "\\subset", true);

@@ -646,2 +646,4 @@ defineSymbol(math, main, rel, "\u2283", "\\supset", true);

defineSymbol(text, main, textord, "~", "\\textasciitilde");
defineSymbol(text, main, textord, "\\", "\\textbackslash");
defineSymbol(text, main, textord, "^", "\\textasciicircum");
defineSymbol(math, main, rel, "\u2191", "\\uparrow", true);

@@ -777,2 +779,20 @@ defineSymbol(math, main, rel, "\u21d1", "\\Uparrow", true);

// Blackboard bold and script letters in Unicode range
defineSymbol(math, ams, textord, "C", "\u2102"); // blackboard bold
defineSymbol(text, ams, textord, "C", "\u2102");
defineSymbol(math, ams, textord, "H", "\u210D");
defineSymbol(text, ams, textord, "H", "\u210D");
defineSymbol(math, ams, textord, "N", "\u2115");
defineSymbol(text, ams, textord, "N", "\u2115");
defineSymbol(math, ams, textord, "P", "\u2119");
defineSymbol(text, ams, textord, "P", "\u2119");
defineSymbol(math, ams, textord, "Q", "\u211A");
defineSymbol(text, ams, textord, "Q", "\u211A");
defineSymbol(math, ams, textord, "R", "\u211D");
defineSymbol(text, ams, textord, "R", "\u211D");
defineSymbol(math, ams, textord, "Z", "\u2124");
defineSymbol(text, ams, textord, "Z", "\u2124");
defineSymbol(math, main, mathord, "h", "\u210E"); // italic h, Planck constant
defineSymbol(text, main, mathord, "h", "\u210E");
// The next loop loads wide (surrogate pair) characters.

@@ -779,0 +799,0 @@ // We support some letters in the Unicode range U+1D400 to U+1D7FF,

@@ -29,3 +29,3 @@ // @flow

// Allowable token text for "break" arguments in parser.
export type BreakToken = "]" | "}" | "$" | "\\)" | "\\cr";
export type BreakToken = "]" | "}" | "\\endgroup" | "$" | "\\)" | "\\cr";

@@ -36,2 +36,1 @@ // Math font variants.

"sans-serif-bold-italic" | "sans-serif-italic" | "script";

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc