Commit Graph

1207 Commits

Author SHA1 Message Date
Kevin Barabash
151376e8aa Port katex-a11y.js to KaTeX (#2062)
* copy katex-a11y.js from webapp to contrib/to-a11y-string.js

* first pass of updating to-a11y-string to use flow

* Set up test harness and write some tests
- add flow types for jest
- create wallaby config file
- add prettier as a dep and set up .prettierrc so that we use .toMatchInlineSnapshot() and have jest insert the snapshot for us
- add lots of TODOs (I'll create tickets for these later)

* Add some  to get the tests passing for now

* remove commented out parts of wallaby.js config file

* remove some stale strings, fix flow issue, add more coverage

* add , add few more tests, handle middle

* fix minor nits in tests

* rename to-a11y-string to render-a11y-string, updatte webpack config to build extension

* add test for \boxed

* remove commented out code
2019-08-02 11:24:51 -04:00
Erik Demaine
d82d09bebd Suggest <!DOCTYPE html> in documentation (#2052)
* Suggest <!DOCTYPE html> in documentation

Inspired by #2047

* Add starter template

* Mention <iframe>s

* Set default docs page to Browser
2019-07-24 23:17:41 +09:00
Erik Demaine
285c9fe0b6 Re includegraphics (#2053)
* Re-enable \includegraphics now that we have trust setting

This reverts commit 5806b240b3.

* Include Khan Academy test logo in repo and use in test (fix #1892)

* Update screenshots

* Update documentation

* Add tests, cleanup existing tests

* Update snapshots

* Enable trust testing (trust=true by default)
2019-07-22 00:15:29 +09:00
navsgh
223b9c3f24 Add Katex Expression (#2049)
A web component, built with Stencil, to render KaTeX expressions. Stencil uses a dynamic loader to load the custom elements polyfill only on browsers that need it.
2019-07-18 14:25:45 -04:00
Erik Demaine
9c7f26b479 Fix argument font sizing in \fbox and \raisebox, fix font sizing in \TeX, \LaTeX, \KaTeX (#1787)
* Remove forced \normalsize in \raisebox

Fix #1786 (incorrect size of "E" in `\TeX`) by fixing `\raisebox` to
keep the current font size.  Previously, `\raisebox` was rendering its
second argument as if it were in `\normalsize\textrm{...}`; now,
the argument is just as if it were in `\textrm{...}`.

* Fix screenshots

* New "hbox" argument type to convert box-like arguments

* Review comments

* Fix \fbox to use hbox argument

* Render A in \LaTeX and \KaTeX in \scriptstyle (not \scriptsize)

* Add screenshot test

* Revert .sizing { width: min-content} thanks to #2044
2019-07-18 11:24:00 -04:00
Ron Kok
2dc8f8121a Support \operatorname* (#1899)
* Support \operatorname*

* Fix lint errors

* Fix YAML

* Update screenshots

* Break out a function to avoid code duplication

* Fix lint errors

* Restore wrapper span

* Update docs

* Reinstall color macros lost in merge

* Update screenshots

* Add type annotations, Move to utils file, add \limits to screenshots

* Fix lint errors

* Rearrange screen shot to fit onto page

* Update screenshots

* tweak location of utils.js and assembleSupSup.js
2019-07-17 21:38:44 -04:00
Erik Demaine
08df67b7cd Fix font choice in operators like \log (e.g. \boldsymbol{\log}) (#2041)
* Fix font choice in operators like \log (e.g. \boldsymbol{\log})

Fix #1971 by correctly passing arguments into the font choice for
the HTML handler for operators like \log.

* Extend BoldSymbol screenshot test

* Require options argument in mathsym to avoid this type of bug in the future

* Update screenshot
2019-07-16 15:08:17 -07:00
Ron Kok
3d9a094b67 Add Unicode digamma to documentation (#2045) 2019-07-16 17:16:07 -04:00
Erik Demaine
403126e56d Do not force sizing groups to display inline-block (#2044)
Fix #1788 by removing `display:inline-block` rule from `.sizing`.
I don't see why a sizing change cares about the display mode, and it
fixes the interaction between `makeVList` and sizing commands.
It should also allow me to remove a `.sizing { width:min-content }` rule
that I had to add in #1787.
2019-07-16 17:00:24 -04:00
dependabot[bot]
45539c2e9c Bump handlebars from 4.1.0 to 4.1.2 (#2036)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.0 to 4.1.2.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.0...v4.1.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-13 22:01:53 -04:00
dependabot[bot]
e055ca8a33 Bump webpack-bundle-analyzer from 3.0.4 to 3.3.2 (#2037)
Bumps [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) from 3.0.4 to 3.3.2.
- [Release notes](https://github.com/webpack-contrib/webpack-bundle-analyzer/releases)
- [Changelog](https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/webpack-bundle-analyzer/compare/v3.0.4...v3.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-13 21:56:31 -04:00
dependabot-preview[bot]
95d2690322 Bump flow-bin from 0.93.0 to 0.102.0 (#2013)
* Bump flow-bin from 0.93.0 to 0.102.0

Bumps [flow-bin](https://github.com/flowtype/flow-bin) from 0.93.0 to 0.102.0.
- [Release notes](https://github.com/flowtype/flow-bin/releases)
- [Commits](https://github.com/flowtype/flow-bin/compare/v0.93.0...v0.102.0)

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

* Bump flow-bin from 0.93.0 to 0.102.0

Bumps [flow-bin](https://github.com/flowtype/flow-bin) from 0.93.0 to 0.102.0.
- [Release notes](https://github.com/flowtype/flow-bin/releases)
- [Commits](https://github.com/flowtype/flow-bin/compare/v0.93.0...v0.102.0)

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

* fix issue with flow after upgrading
2019-07-13 20:17:19 -04:00
dependabot-preview[bot]
0a55eb8a64 Bump commander from 2.19.0 to 2.20.0 (#2020)
Bumps [commander](https://github.com/tj/commander.js) from 2.19.0 to 2.20.0.
- [Release notes](https://github.com/tj/commander.js/releases)
- [Changelog](https://github.com/tj/commander.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tj/commander.js/compare/v2.19.0...v2.20.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-13 19:56:53 -04:00
dependabot-preview[bot]
9182b8aae4 Bump eslint-plugin-flowtype from 3.4.2 to 3.10.4 (#2023)
Bumps [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype) from 3.4.2 to 3.10.4.
- [Release notes](https://github.com/gajus/eslint-plugin-flowtype/releases)
- [Commits](https://github.com/gajus/eslint-plugin-flowtype/compare/v3.4.2...v3.10.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-13 19:45:06 -04:00
dependabot-preview[bot]
89042d80e3 Bump css-loader from 2.1.0 to 3.0.0 (#2021)
Bumps [css-loader](https://github.com/webpack-contrib/css-loader) from 2.1.0 to 3.0.0.
- [Release notes](https://github.com/webpack-contrib/css-loader/releases)
- [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/css-loader/compare/v2.1.0...v3.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-13 19:36:24 -04:00
dependabot-preview[bot]
d98164dd42 [Security] Bump lodash from 4.17.11 to 4.17.14 (#2030)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.14. **This update includes security fixes.**
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-13 19:27:43 -04:00
Kevin Barabash
2fd0bd94de Replace greenkeeper badge with dependabot badge (#2022) 2019-07-13 19:19:22 -04:00
dependabot-preview[bot]
403a728df5 Bump istanbul-lib-coverage from 2.0.3 to 2.0.5 (#2017)
Bumps [istanbul-lib-coverage](https://github.com/istanbuljs/istanbuljs) from 2.0.3 to 2.0.5.
- [Release notes](https://github.com/istanbuljs/istanbuljs/releases)
- [Commits](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-coverage@2.0.3...istanbul-lib-coverage@2.0.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-08 23:28:38 -04:00
dependabot-preview[bot]
572fa9cc32 Bump babel-plugin-istanbul from 5.1.1 to 5.1.4 (#2012)
Bumps [babel-plugin-istanbul](https://github.com/istanbuljs/babel-plugin-istanbul) from 5.1.1 to 5.1.4.
- [Release notes](https://github.com/istanbuljs/babel-plugin-istanbul/releases)
- [Changelog](https://github.com/istanbuljs/babel-plugin-istanbul/blob/master/CHANGELOG.md)
- [Commits](https://github.com/istanbuljs/babel-plugin-istanbul/compare/v5.1.1...v5.1.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-08 23:16:15 -04:00
dependabot-preview[bot]
a1b6d4d655 Bump eslint from 5.14.1 to 5.16.0 (#2016)
Bumps [eslint](https://github.com/eslint/eslint) from 5.14.1 to 5.16.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v5.14.1...v5.16.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-08 22:51:43 -04:00
Erik Demaine
3800dc49c1 [breaking] trust setting to indicate whether input text is trusted (#1794)
* trust option to indicate whether input text is trusted

* Revamp into trust contexts beyond just command

* Document new trust function style

* Fix screenshot testing

* Use trust setting in \url and \href

* Check `isTrusted` in `\url` and `\href` (so now disabled by default)
* Automatically compute `protocol` from `url` in `isTrusted`, so it
  doesn't need to be passed into every context.

* Document untrusted features in support list/table

* Existing tests trust by default

* remove allowedProtocols and fix flow errors

* remove 'allowedProtocols' from documentation

* add a comment about a flow error, rename urlToProtocol to protocolFromUrl

* add tests test that use function version of trust option

* default trust to false in MathML tests

* fix test title, remove 'trust: false' from test settings since it's the default
2019-07-08 21:57:23 -04:00
Ron Kok
fc79f79c78 Support Unicode \digamma (#2010)
* Support Unicode \digamma

* Update screenshotter images
2019-07-05 20:01:51 -04:00
Ron Kok
3c075faa1b Fix \sqrt SVG path (#2009) 2019-07-05 13:13:56 -04:00
Ron Kok
2139adffdb Prevent gaps in tall delimiters (#1986)
* Prevent gaps in tall delimiters

* Improve lap vertical alignment

* Fix lint errors

* Remove outdated comment

* Move a declaration out of makeStackedDelim()

* Update screenshots
2019-07-05 10:16:24 -04:00
Erik Demaine
f63733a35e Document mhchem \cf not supported (use \ce instead) (#2008)
* Document mhchem \cf not supported (use \ce instead)

* Mention \cf -> \ce in support table
2019-07-05 02:02:09 -04:00
Ron Kok
2b83935064 Improve MathML for classes (#1929)
* Improve MathML for classes

* Fix lint errors

* Fix another lint error

* Simplify MathML resulting from single character box

* Fix lint errors

* make some of the arrays in our html/mathml helper functions readonly
2019-07-05 01:14:05 -04:00
Erik Demaine
19d9d83ad3 \color affects following \right, put array cells in their own groups (#1845)
* \color affects following \right

Fix #1844 by giving `leftright` nodes a `rightColor` attribute for how
to color the right bracket.  Now `\color` sets the macro
`\current@color` in the current environment (in particular, resetting
after `\right`), just like `color.sty` does in LaTeX.  This is used to
specially pass the current color into any following `\right` and then
into the `leftright` parse node.

* Add test

* Put each array cell in its own group/namespace

* Improve cell group isolation, add test and TODO

* Improve comments
2019-07-05 00:27:55 -04:00
Tonton Pixel
39da3f5119 Add "Tutti Quanti Shelf" app (#1997)
* Add "Tutti Quanti Shelf" app

Utilities making use of the KaTeX library have been split between the original app "Vade Mecum Shelf" ("Trigonometric Formulas" utility) and the new app "Tutti Quanti Shelf" ("LaTeX Math Renderer" utility)...

* Link to new app icon

* Update siteConfig.js

* Update siteConfig.js

Fixed image path
2019-06-16 18:08:37 -04:00
elbaro
88d9a8a4df Add \plim (#1952)
* Add \plim

* tweak position of argmin and plim in support table
2019-06-01 20:20:26 -04:00
Daniel Hollas
d1dfd88166 DOC: Fix path to built file (#1976) 2019-05-27 16:38:41 -04:00
Ron Kok
f9dafea6a6 Enable minRuleThickness in rendering options (#1964)
* Enable minRuleThickness in rendering options

* fix typo

* Fix lint errors

* Fix default

* Remove border from \colorbox

* Fix lint error

* Update array screenshot

* Add border to \fcolorbox

* Edit comment

* Add comment

* Pick up review comments

* Fix lint errors

* Edit \sqrt screenshot test

* Update screenshots

* Screenshot update take 2

* Improve \sqrt SVG paths

* Fix lint error
2019-05-25 18:39:16 -04:00
Ron Kok
17e89efdfc Fix \pmb (#1924)
* Fix \pmb

* Update screenshots

* Use \mathbf for MathML
2019-05-25 11:03:03 +09:00
Ron Kok
3b60aee16c Support {smallmatrix}, {subarray}, and \substack (#1969)
* Support {smallmatrix}, {subarray}, and \substack

* Fix lint errors

* Update docs. Screenshots step 1.

* Screenshots step 2

* Screenshots step 3

* Pick up review comments

* Fixed arraycolsep for {smallmatrix}

* Fixed lint error

* Updated screenshots
2019-05-20 23:34:49 -04:00
Ron Kok
6b0f06df21 Improve MathML fonts (#1965) 2019-05-19 19:24:34 -04:00
Ron Kok
c8f2783ca8 Remove unclosed TODO comment (#1979) 2019-05-18 18:32:44 -04:00
Ron Kok
9822414733 Render MathML directly (#1966)
* Render MathML

* Fix lint error

* Change from main api to rendering options
2019-05-13 19:31:04 -04:00
Ben Dyer
4f2da04e5d Add test for double square brackets to katex-spec (#1956) 2019-05-12 23:25:25 -04:00
Kevin Barabash
f659544d62 Release v0.10.2 (take 4) (#1961)
* Release v0.10.2

Bump master to v0.10.3-pre

* update CHANGELOG

* add integrity hash to mhchem script in README

* tweaked CHANGELOG
2019-05-12 22:08:30 -04:00
mbarkhau
17bfb247b8 Fix broken link (#1962) 2019-04-30 11:01:04 -04:00
Thomas Mathew
fb103bb147 Include extensions mhchem & copy-tex in home-page (#1932)
* Include extensions mhchem & copy-tex in website home-page

* Use relative link to mhchem and copy-tex

- Included relative links extensions mhchem & copy-tex in website/pages/index.html
- Included copy commands in website/lib/build.js. Will be used in 'yarn build'
- Included 2 more files in .gitignore

* Correct CDN path of extensions

* tweak grammar and alignment of a comment
2019-04-28 20:29:49 -04:00
Erik Demaine
5aad8f9f32 Test for duplicate symbols/macros (#1955)
* Test for duplicate symbols/macros

We've had a few cases where we accidentally include the same symbol or macro
definition in both macros.js and symbols.js.  This new test automatically
detects these scenarios during Jest testing.

* Fix lint errors
2019-04-28 19:52:39 -04:00
ylemkimon
664dc6ab74 Add more documentation on font loading & prefetch fonts on the website (#1895)
* Add more documentation on font loading

* Prefetch fonts on the website
2019-04-28 18:44:34 -04:00
Kevin Barabash
5806b240b3 disable \includegraphics until trust settings is merged (#1951)
* disable \includegraphics until trust settings is merged

* disable one more test
2019-04-28 17:52:27 -04:00
Tesla_Ice_Zhang
6bb312f687 Support double-square curly braces (#1953)
* Support double-square curly braces

Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>

* Rename `llbrace` to `lBrace`

* Address comments: add mathml

* Fix code style

* Fix doc

* Add to docs/support_table
2019-04-25 07:23:00 -07:00
Erik Demaine
2d066097ad Remove redundant symbols from #1947 (#1954)
https://github.com/KaTeX/KaTeX/pull/1947#pullrequestreview-230534608
2019-04-25 09:46:22 -04:00
Ben Dyer
d01a972f5c Add symbol double square brackets (#1947)
* Add symbol double square brackets

* Update name for double square brackets, add macros and documentation
2019-04-23 18:49:50 -07:00
Ron Kok
0461e17c8e Prevent inadvertent tall delims (#1948) 2019-04-24 00:59:32 +09:00
ylemkimon
f948947736 Add KaTeX version to stylesheet and troubleshooting guide (#1893)
* Add KaTeX version to stylesheet

* Add troubleshooting guide

* Update katex.less

[skip ci]
2019-04-18 22:10:19 +09:00
Daniel Hollas
e7193227f6 Move custom colors used by Khan into macros.js (#1933) 2019-04-17 22:22:02 -04:00
Jude Fernandes
41dd71c241 Added Android library (#1943)
* Added Android library 

Added a link to the android library for katex rendering.

* Update the name to include correct capitalization
2019-04-17 22:08:09 -04:00