* 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>
* 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
* 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
* 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
* 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
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.
* Update LICENSE to acknowledge individual copyrights as well
* Update copyright year
* Update website to acknowledge individual copyrights as well
* Update LICENSE
* Update siteConfig.js
* \@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
* 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
* 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
* 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
* 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
* 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