* Update comment for defineFunction handler.
* Rename .value to .text in all token-style ParseNodes.
* Rename symbolNode's .value to .text.
* Rename color-token's .value to .color.
* Fix roots
* Update screenshots
* Added a test in a craven gambit to get a green check mark
* Adjust small radicals
* Fix lint error
* Update screenshots
* Comments without terminating newlines in nonstrict mode
Fix#1506 by allowing single-line comments (`%` without terminating newline)
in nonstrict mode. `Lexer` and `MacroExpander` now store the `Settings`
object, so the `Lexer` can complain about missing newline according to the
`strict` setting. I filtered this out from the snapshot tests with a slightly
different `replacer`.
* Reimplement \href like \verb, add \url
Major restructuring to lex URL arguments differently, e.g. to support
`\href%{hello}` and `\href{http://foo.com/#test%}{hello}`. The new URL
parsing code is simpler, but involves a special case in `parseSymbol`
like `\verb`.
Also add support for `\url` while we're here.
* Cleanup
* Fix flow errors and improve error messages
* Add \url to documentation
* Improve doc formatting
* Switch from nomnom to commander
* Fix#1489
* --macro repeatable option replaced with single --macros option with ";"
separator (until https://github.com/tj/commander.js/issues/674)
* Add missing --max-expand option
* Replace expired --unicode-text-in-math-mode option with --strict
(https://github.com/Khan/KaTeX/issues/1483#issuecomment-405108291)
* Add instructions for how to run in the opening comments
* Clean up option doc strings
* Implement @ylemkimon's comments
* Fix try/const bug
* Fix use of --selenium-ip
It was a quirk that --seleniumIP worked. --help lists --selenium-ip.
* Implement comments, restore --macro repeatable argument
* Cleanup
* Restore 0 default for maxExpand
* Fix more comments from @ylemkimon
* npm run dist -> npm run build
In preparation for #1500
* Fix line length error
* Fix \not vertical alignment
Fix#1491 by changing from `position: absolute` to `position: relative`.
* Switch to \rlap implementation of \not
* Separate \not the macro from \not the symbol via \@not
* Fix test
* Support \pmb
* Fix lint error
* Add phony screenshots
* Screenshots take two
* Screenshots take three
* Simplify copies
* Move determination of mclass from handler to htmlBuilder
* Change to a macro definition
* Update screenshots
* Pick up review comments
* Clean up nesting of braces
* Update screenshot
* Refactor test helpers
* Combine common codes from `parse` and `build`, and dispatch using
`Mode`
* Remove `toNotBuild` and `toNotParse` and use `expect.not`
* Remove `Warning` and instead mock `console.warn`
* Add `expect.toHavePassed` and check whether parse/build succeeded
lazily
* Improve failed test `message`:
- Use color
- Print stack traces(excluding internals)
- Print diff
- Follow jest matcher output style
* Update helpers.js
* Remove toBeTruthy checks
getParsed throws an error if parsing fails.
* Used tagged literals
* Use .toHaveLength
* Use tagged literals
* Use to{Build,Parse}Like where possible
* Remove compareParseTree
* Use snapshot where possible
* Join into one line where <88 chars
* Revert console.warn() to throw an error
Merge `expectToWarn` to `expectKaTeX`, like
`expect.toFailWithParseError`
* Remove call to console.warn from stack traces
* Fix merge errors
* Remove `getTree`
* Move `_getBuilt` into `getBuilt`
* Move default settings and tagging literal support in to `getParsed`
and `getBuilt`
* Remove stack traces clean-up
* Remove `toHavePassed` matcher
* Extract `expected` string construction into `printExpectedResult`
* \@binrel command and refactor
New `\@binrel{x}{y}` command renders `y` as if it's a bin/rel/ord like `x`.
This is equivalent to AMSTeX's `\binrel@{x}\binrel@@{y}`.
It will hopefully be useful for macros, such as `\pmb` (#1418).
Also refactor the (already duplicated) code for implementing this
functionality into buildCommon.binrelClass.
* Add tests; fix flow error
* Another test
* Move binrelClass to functions/mclass.js
* Remove expensive array destructuring polyfill
* \html@mathml
Fix#1452
* Add missing file
* Implement \char (via internal \@char)
* Remove excess <mstyle> wrapper on \mathbin etc.
* Fix tests
* Add Unicode support for \copyright and \textregistered
Testing that this doesn't lead to an infinite loop thanks to \char` escaping.
* Add tests
* Use assertNodeType
* Switch from regex to lookup table, and no parseInt
* Support \genfrac and \above
* Accommodate delimiters inside groups
* Update screenshots take one`
* Update screenshots take two
* Fix flow error
* Fix lint error
* Automatic mrel/mbin spacing for \boldsymbol
Fix#1154
* Add test
* Add missing mode
* Separate out \boldsymbol support to correct flow types
* Fix ternaries thanks to @ronkok's comment
* Revert package-lock.json
* Add screenshot test
* Add and expose addFontMetrics function
* fix typo
* recreate package.json-lock
* Add setFontMetrics function to change the defualt metricMap - change getFontMetrics to getGlobalMetrics
* use new setFontMetrics on main KaTeX object
* fix package-lock.json error by rebuilding it
* Add appropriate tests
* update the snapshot
* \newcommand, \renewcommand, \providecommand
* Tests
* Add comment
* Add symbols to the set of already defined things
* Add implicitCommands, catch \hline outside array
* Add \relax
* Move isDefined to be a method of MacroExpander
* Namespace.has
* Reword error messages
* Add \hdashline given #1407
* Support \hdashline
Support `\hdashline` from package `arydshln`. This PR acts as a complement to PR #1395.
Similarly to #1395, the dashed line is rendered as `border-bottom-style: dashed;`. That does not exactly match the `dashsegment` and `dashgap` lengths in `arydshln`, but it does render black lines with sharp edges.
* Fixed top line position
* Add screenshots
* Fix lint error
* Fix another lint error
* Deleted HLine screenshots
* Pick up comments
* Fix ligatures not always triggering
Example: \text{\rm --} would not cause ligature but should
* Remove ligatures in \texttt mode
* Add screenshot tests
* Fix MathML ligatures
* Fix type
* Handle \text... fonts in MathML building
* Remove leftover console deubgging
* hacked together a dashed vertical bar
* Updated tests and spec.
* tidied up the screenshot template for arrays
* added the vertical lines at the end back
* Updated screenshots for arrays
* Support \arraystretch as a macro definition
Also add `expandMacro` and `expandMacroAsText` helpers to `MacroExpander`.
* Remove excess defaulting
* Add test
* Fix \cancel
Fixes#1080.
Improve `\cancel` in three ways:
1. Better lateral spacing.
2. Steeper `\cancel` lines on single characters.
3. Treat height and depth to match the `cancel` package behavior, not its documentation.
* Update screenshots
* Support \cfrac
This was an easier PR to write than #135 since KaTeX now has well established methods for pt-to-em conversions and nulldelimiter.
As in #135, this does not support the LaTeX optional argument for numerator justification. It supports a `\cfrac #1#2 ` syntax.
* Added screenshotter files
* fix ref to context in genfrac handler
* Make letter tests strict
The recently added rendering mode `strict:"warn"` will allow any Unicode characters to be accepted. We expect `strict: true` to be pickier than that.
This PR sets `strict: true` on tests in `katex-spec.js` that should enforce that pickiness.
* Pick up comments
* Fix import of strictSettings
* Rewrite spacing commands as macros
Fix#1130 by defining `\!`, `\negthinspace`, `\,`, `\thinspace`, `\:`,
`\medspace`, `\;`, `\thickspace`, `\negmedspace`, `\negthickspace`,
`\enspace`, `\enskip`, `\qquad`, `\quad` as macros.
Fix#1036 by defining a new `SpaceNode` in mathMLTree that recognizes
all special space amounts from
https://www.w3.org/TR/2000/WD-MathML2-20000328/chapter6.html
* Fix <mspace> rendering and add a test to catch it
* Update screenshots
* Wrap special space characters in <mtext>
* Update screenshots
* Fix MathML escaping behavior
* Fix flow typos
* Fix Unicode-chrome
* Reimplement mod operators in terms of macros
* Rerun ModScript
* Remove excess table entries (now already macros)
* Fix bmod