Commit Graph

1258 Commits

Author SHA1 Message Date
Brent Yi
206fbd0126 Submodule fix for "build from source" instructions (#2239) 2020-04-13 09:49:34 -04:00
Sophie Alpert
f09955c547 Fix grammar error in tagline (#2231) 2020-04-05 12:32:09 -04:00
Ron Kok
69a22d3cfb Support MathML display mode (#2220) 2020-03-24 02:28:43 +09:00
dependabot-preview[bot]
284ccc602a [Security] Bump acorn from 5.7.3 to 5.7.4 (#2217)
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4. **This update includes a security fix.**
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-21 22:51:15 +09:00
ylemkimon
9917d1ce84 Add support for \expandafter, \noexpand, \edef, \let, and \long (#2122)
* Add support for \expandafter

* Add support for \noexpand

* Add support for \edef

* Update comments

* Allow \long before macro definition

* Update documentation

* Update comments

* Fix defPrefix

* Add support for \let

* Update documentation

* Print error token

* Update documentation

* Check whether command is expandable

* Add tests

* Fix token order

* Make noexpand a Token property

* Throw error if control sequence is undefined when expanding

* Rename expandableOnly to expandOnly

* Make unexpandable macro property

* Move \expandafter to macros.js

* Add TODO

* Fix merge conflict

* Update a test case

* Remove unused functions in MacroContextInterface

* Update comments

* Refactor code

* Move \noexpand to macros

* Update MacroExpander.js

* Add a test case

* Separate control sequence check to a function

* Add support for \futurelet

* Separate RHS getter to a function

* Update documentation

* Move expandOnly logic to expandOnce

* Refactor code and update comments

Co-authored-by: Kevin Barabash <kevinb@khanacademy.org>
2020-03-11 12:14:34 +09:00
Cheng XU
d6a4379b49 libs.md: add Rust library (#2195)
Add a mention to the Rust library <https://github.com/xu-cheng/katex-rs> in the document.

Co-authored-by: Kevin Barabash <kevinb7@gmail.com>
2020-02-22 09:39:58 -05:00
ylemkimon
f7334e4eeb Update fonts: remove unused glyphs and Macintosh table (#2171)
Co-authored-by: Kevin Barabash <kevinb7@gmail.com>
2020-02-21 17:39:18 -05:00
dependabot-preview[bot]
213f317fca [Security] Bump codecov from 3.2.0 to 3.6.5 (#2202) 2020-02-21 13:48:33 +00:00
ylemkimon
3205e91731 Upgrade minimum development Node version to v10 (#2177)
Node v8 will reach its end-of-life by December 2019.

Co-authored-by: Erik Demaine <edemaine@mit.edu>
2020-01-06 13:58:04 -05:00
Erik Demaine
e85fdd7212 Improve server-side rendering documentation (#2178)
* Improve server-side rendering documentation

* Fix typo

* Document Node + mhchem

* Re-order require statements

Co-authored-by: ylemkimon <mail@ylem.kim>
2020-01-04 19:55:12 +09:00
Erik Demaine
3cb9bd78bb Fix delimiter error message (#2186)
* Fix delimiter error message

Avoid "circular structure" error message by avoiding JSON.stringify on a
parse structure when getting an invalid delimiter type (e.g. ordgroup).
Instead, report type of delimiter when it's invalid.  Fixes #2184.

* Fix and add tests
2020-01-04 18:10:11 +09:00
dependabot-preview[bot]
754e79a12e [Security] Bump handlebars from 4.1.2 to 4.5.3 (#2181) 2019-12-27 16:26:29 +00:00
Aleksey Nagovitsyn
81258c5040 Add "option" to ignoredTags (#2180) 2019-12-24 13:10:09 +09:00
Rui Okada
4b905064ab Add bra-ket notation (#2162)
* Add bra-ket notation

* Fix typo

* Remove ketbra

* Remove ketbra, add Bra and Ket

* Add Bra/Ket and fix a typo in bra's source

* Fix bra-ket typo in docs

* Fix bra-ket escape typo in docs

* Replace bra-ket pipe with \vert in docs
2019-12-11 22:02:19 -05:00
ylemkimon
800cdb2d23 Cleanup font build scripts & minor font updates (#2155)
* Minor font updates

* Update screenshots

* Cleanup build scripts
2019-12-07 13:11:45 +09:00
ylemkimon
c8c7c3954c Minor symbols.js formatting changes (#2151)
* Set acceptUnicodeChar for quote symbols

* Remove \oiint and \oiiint which have no glyphs

* Make symbols.js ASCII-safe

* Remove duplicate entries

* Use acceptUnicodeChar where applicable
2019-12-04 20:13:06 -05:00
ylemkimon
b1eeeecf91 Move \global and \def to functions (#2138)
* Add parseNode type `internal`

* Move \def and \newcommand to functions

* Fix Flow error

* Separate \global

Move \newcommand back to macros for now

* Rename assignment.js to def.js

* Update test cases

* Add comments

* Update a test case
2019-12-04 20:07:19 -05:00
ylemkimon
0d8830af30 Add \message, \errmessage, and \show for debugging (#2135)
* Add \message, \errmessage, and \show for debugging

* Remove unnecessary parentheses

* add tests for \message and \errmessage
2019-12-01 18:24:47 -05:00
ylemkimon
e5333ad04d Add HTML extension (#2082)
* Add html extension

* Fix flow error

* Update documentation

* Add tests

* Call buildA11yStrings for "html" node

* Throw ParseError when parsing \htmlData fails

* Improve documentation

* Add a screenshotter test

* Add dummy screenshot

* Update screenshots
2019-12-01 17:49:28 -05:00
Erik Demaine
9d8195c793 Reword unicode test comments (#2161) 2019-12-01 21:11:14 +09:00
Karl Traunmüller
8fcfe97e11 Fix test that was checking numerator instead of denominator (#2160)
* Test was checking numerator instead of denominator

* fixed a typo
2019-11-30 09:33:20 -05:00
ylemkimon
fa8fbc0c18 Remove checkNodeType and assert/checkAtomFamily (#2137)
We used functions with $FlowFixMe as Flow couldn't refine ParseNode 
using its type. It seems the issue has been fixed and complicated 
function calls can be removed.
2019-11-29 15:08:22 -05:00
dependabot-preview[bot]
981a9ea3a0 [Security] Bump https-proxy-agent from 2.2.1 to 2.2.4 (#2158)
Bumps [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent) from 2.2.1 to 2.2.4. **This update includes security fixes.**
- [Release notes](https://github.com/TooTallNate/node-https-proxy-agent/releases)
- [Commits](https://github.com/TooTallNate/node-https-proxy-agent/compare/2.2.1...2.2.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-19 14:37:52 +09:00
Aleksey Nagovitsyn
1e3471b290 auto-render: do not touch text nodes w/o formulas (#2154) 2019-11-18 13:18:02 +09:00
Ron Kok
d1cee3cf3d Support {rcases} and {drcases} (#2149)
* Support {rcases} and {drcases}

* Fix lint error

* Update screenshots
2019-11-10 18:36:02 +09:00
Peder B. Sundt
0772ac0e45 Minor formatting changes (#2143) 2019-11-06 15:50:48 +09:00
ylemkimon
4ec2806b3e Drop IE 9/10 support (#2136)
* Drop IE 9/10 support

* Remove IE-related comments

They no longer apply.

* Update browserslist

* Exclude old Safari (5.1)
2019-11-01 18:43:47 -04:00
ylemkimon
b14197d9c9 Update LICENSE and website to acknowledge individual copyrights as well (#2106)
* Update LICENSE to acknowledge individual copyrights as well

* Update copyright year

* Update website to acknowledge individual copyrights as well

* Update LICENSE

* Update siteConfig.js
2019-11-01 12:25:41 -04:00
Ron Kok
194b0064bc Improve MathML for corners (#1922) 2019-11-01 12:19:06 -04:00
Ron Kok
a92e39d810 Fix laps
* Fix lap with flex

* Fix lint error

* Fix more lint errors

* Fix indentation in test spec

* Update screenshots

* remove .glue class
2019-11-01 02:23:28 +09:00
Ron Kok
d10f375eed Fix \boxed inherited color (#2130) 2019-10-19 14:22:42 +09:00
kzvi
0843e9556e add spacing on left of fleqn display math (#2127)
* add spacing on left of fleqn display math

* update description of fleqn in docs/options.md

to include new spacing
2019-10-18 12:22:52 -04:00
Erik Demaine
0cdb28b256 \@ifnextchar consumes spaces (#2118)
* \@ifnextchar consumes spaces

Fix #2117 by fixing our implementation of \@ifnextchar to match LaTeX's:
consuming spaces before checking the next character.  See #2117 for details.

* Update MacroContextInterface
2019-10-13 00:33:30 +09:00
Erik Demaine
1eda0e86a0 Add support for \cal (#2116)
Fix #2115 by adding \cal to list of old-style font commands.
(Surprisingly tiny change!)
Add tests for all old-style font commands.
2019-10-10 20:46:10 -04:00
ylemkimon
634b4e2ae4 Add 'trust' setting to demo (#2107)
Ask if enabling 'trust' from the permalink
2019-10-02 21:06:53 -04:00
ylemkimon
be0c79b375 Disable eslint jest environment in non-test files (#2104) 2019-10-02 21:00:05 -04:00
ylemkimon
df4a580c94 Set border-collapse: collapse in vlist (#2103)
Fixes #2100 (any vertical layouts within <table>).
2019-10-02 20:51:58 -04:00
ylemkimon
5acd8143d7 Remove greenkeeper.json (#2105) 2019-10-02 20:39:37 -04:00
Fabio Spampinato
7093b0ce39 Notable: update (#2108)
* Added “Notable” to the list of users

* Added missing trailing comma

* alphabetize the new entry

* Notable: updated icon and website url
2019-09-29 13:07:47 +09:00
Evan Widloski
166f1f6798 mathtex-script: Use html 'defer' attribute (#2069)
* Use html 'defer' attribute

Instead of putting the extension script tag at the bottom, we can use the `defer` attribute to execute the script after all other content is loaded.  It has [very good](https://caniuse.com/#feat=script-defer) browser support.

* fix checksums

* use sha384 hashes

* update to Katex 0.11.1
2019-09-28 00:58:04 +09:00
Fabio Spampinato
ad4a8778ae Added “Notable” to the list of users (#2086)
* Added “Notable” to the list of users

* Added missing trailing comma

* alphabetize the new entry
2019-09-22 15:11:19 -04:00
Ciro Santilli,Opinions and content are my own, not my employer's,2018新疆改造中心,1989六四事件,1999法轮功 ,2019 996.ICU, 2018包子露宪,2015 710律师劫,2015巴拿马文件 邓家贵,2017低端人口,2008西藏骚乱scriptalert(1)/script
36595343b7 Create globalGroup option to place definitions in global scope (#2091)
If true, this allows \newcommand definitions to persist across calls to
renderToString.

Fix https://github.com/KaTeX/KaTeX/issues/2070
2019-09-22 15:03:44 -04:00
Michael Polyak
f03671ce61 Release v0.11.1 (#2098)
* Release v0.11.1

Bump master to v0.12.0-pre

* Update CHANGELOG.md for v0.11.1-release

* Update CHANGELOG.md with Changes section for v0.11.1-release
2019-09-18 08:40:01 -04:00
dependabot-preview[bot]
a790a69bd2 [Security] Bump mixin-deep from 1.3.1 to 1.3.2 (#2090) 2019-09-03 14:33:08 +00:00
dependabot-preview[bot]
ef6f52f5cd [Security] Bump eslint-utils from 1.3.1 to 1.4.2 (#2089)
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2. **This update includes a security fix.**
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-27 11:11:30 -04:00
Erik Demaine
2a3013d72a Fix parse timing by separating consume() into fetch() and consume() (#2054)
* Fix parse timing by separating consume() into fetch() and consume()

Fix #1989, and generally cleanup parse timing (many fewer hoops to jump
through) by defining two methods on parser:

1. `consume()` marks the current token (`nextToken`) as "done", but
   doesn't yet fetch the next token (setting `nextToken` to `null`).
2. `fetch()` fetches the next token if we don't already have one
   (e.g., if last token was `consume()`d).

Before this change, `consume()` did both actions.  By separating them,
and allowing the parser to live in a state for a while where `nextToken`
is `null`, it is far easier to change settings (in particular, math/text
mode and catcodes) before reading the next token, in a way that depends
on what we're parsing.  For example, if an argument should be treated in
text mode, we can just set the mode in the argument parser, instead of
when the previous token was consumed.  Similarly, if an argument should
be treated as a URL, we can just set the catcode of `%` in the URL
argument parser, and reset it after.  We no longer have to take care to
reset things before calling `consume()`.

This change mostly involves changing `this.nextToken` to `this.fetch()`.
In a perfect world, we could use slightly fewer calls to `this.fetch()`,
but Flow doesn't realize that `this.nextToken` will be non-null after a
call to `this.fetch()`, so we need to use a few more calls to
`this.nextToken()` or a few more local `nextToken` variables.

* Remove now-unnecessary consumeMath

* Update Parser.js
2019-08-21 16:14:42 +09:00
Erik Demaine
081b44ab57 Use current font for accents (#2066)
* Use current font for accents

Fix #353 using `buildCommon.makeSymbol` to automatically determine font
for the accent symbol.

* Fix screenshots

* Fix flow error

* Fix file permissions
2019-08-20 22:40:40 +09:00
Erik Demaine
96e1156764 Fix \gray's macro definition (#2075)
Fix #2074 by fixing a typo in the macro definition of \gray.
This seems to be the only color incorrectly defined.
2019-08-20 22:19:17 +09:00
Kevin Barabash
1da7ef2210 Release v0.11.0 (#2071)
* Release v0.11.0

Bump master to v0.12.0-pre

* update CHANGELOG.md

* minor editors to CHANGELOG.md
2019-08-12 21:51:13 -04:00
Erik Demaine
3b6ed48f5b Unicode characters in math render in text mode (#2040)
* Unicode characters in math render in text mode

Improve #2031 by rendering all supported Unicode text characters (via
supportedCodepoints) in text mode, mimicking wrapping them in `\text`,
thereby using metrics of letter M as usual.

* Add tests

* Improve documentation

* Implement review comments
2019-08-08 20:33:09 -04:00