From 38620a98e1df0ae48c2aa240d2d0c93e4dcfd0ab Mon Sep 17 00:00:00 2001 From: Andrew Sun Date: Sat, 16 Feb 2019 14:35:38 -0500 Subject: [PATCH] Update 1.10.0 --- .idea/encodings.xml | 4 + README.md | 100 ++- assets/README.md | 154 ++-- assets/contrib/auto-render.js | 885 +++++-------------- assets/contrib/auto-render.min.js | 2 +- assets/contrib/copy-tex.css | 4 +- assets/contrib/copy-tex.js | 202 +++-- assets/contrib/copy-tex.min.css | 2 +- assets/contrib/copy-tex.min.js | 2 +- assets/contrib/mathtex-script-type.js | 82 +- assets/contrib/mathtex-script-type.min.js | 2 +- assets/fonts/KaTeX_AMS-Regular.ttf | Bin 71428 -> 71428 bytes assets/fonts/KaTeX_AMS-Regular.woff | Bin 40200 -> 40200 bytes assets/fonts/KaTeX_AMS-Regular.woff2 | Bin 33208 -> 33208 bytes assets/fonts/KaTeX_Caligraphic-Bold.ttf | Bin 19588 -> 19588 bytes assets/fonts/KaTeX_Caligraphic-Bold.woff | Bin 12136 -> 12136 bytes assets/fonts/KaTeX_Caligraphic-Bold.woff2 | Bin 10608 -> 10596 bytes assets/fonts/KaTeX_Caligraphic-Regular.ttf | Bin 18960 -> 18960 bytes assets/fonts/KaTeX_Caligraphic-Regular.woff | Bin 11868 -> 11868 bytes assets/fonts/KaTeX_Caligraphic-Regular.woff2 | Bin 10412 -> 10412 bytes assets/fonts/KaTeX_Fraktur-Bold.ttf | Bin 35968 -> 35968 bytes assets/fonts/KaTeX_Fraktur-Bold.woff | Bin 23388 -> 23388 bytes assets/fonts/KaTeX_Fraktur-Bold.woff2 | Bin 20488 -> 20488 bytes assets/fonts/KaTeX_Fraktur-Regular.ttf | Bin 34652 -> 34652 bytes assets/fonts/KaTeX_Fraktur-Regular.woff | Bin 22844 -> 22844 bytes assets/fonts/KaTeX_Fraktur-Regular.woff2 | Bin 19868 -> 19860 bytes assets/fonts/KaTeX_Main-Bold.ttf | Bin 61772 -> 61712 bytes assets/fonts/KaTeX_Main-Bold.woff | Bin 36928 -> 36752 bytes assets/fonts/KaTeX_Main-Bold.woff2 | Bin 30824 -> 30620 bytes assets/fonts/KaTeX_Main-BoldItalic.ttf | Bin 44824 -> 44824 bytes assets/fonts/KaTeX_Main-BoldItalic.woff | Bin 26228 -> 26228 bytes assets/fonts/KaTeX_Main-BoldItalic.woff2 | Bin 22176 -> 22188 bytes assets/fonts/KaTeX_Main-Italic.ttf | Bin 47952 -> 47952 bytes assets/fonts/KaTeX_Main-Italic.woff | Bin 27200 -> 27200 bytes assets/fonts/KaTeX_Main-Italic.woff2 | Bin 23064 -> 23056 bytes assets/fonts/KaTeX_Main-Regular.ttf | Bin 70512 -> 70076 bytes assets/fonts/KaTeX_Main-Regular.woff | Bin 39728 -> 39444 bytes assets/fonts/KaTeX_Main-Regular.woff2 | Bin 33096 -> 32864 bytes assets/fonts/KaTeX_Math-BoldItalic.ttf | Bin 0 -> 39744 bytes assets/fonts/KaTeX_Math-BoldItalic.woff | Bin 0 -> 23192 bytes assets/fonts/KaTeX_Math-BoldItalic.woff2 | Bin 0 -> 20044 bytes assets/fonts/KaTeX_Math-Italic.ttf | Bin 41448 -> 41448 bytes assets/fonts/KaTeX_Math-Italic.woff | Bin 23820 -> 23820 bytes assets/fonts/KaTeX_Math-Italic.woff2 | Bin 20416 -> 20432 bytes assets/fonts/KaTeX_SansSerif-Bold.ttf | Bin 34032 -> 34032 bytes assets/fonts/KaTeX_SansSerif-Bold.woff | Bin 19172 -> 19172 bytes assets/fonts/KaTeX_SansSerif-Bold.woff2 | Bin 16000 -> 15996 bytes assets/fonts/KaTeX_SansSerif-Italic.ttf | Bin 31308 -> 31308 bytes assets/fonts/KaTeX_SansSerif-Italic.woff | Bin 18128 -> 18128 bytes assets/fonts/KaTeX_SansSerif-Italic.woff2 | Bin 15204 -> 15212 bytes assets/fonts/KaTeX_SansSerif-Regular.ttf | Bin 30156 -> 30156 bytes assets/fonts/KaTeX_SansSerif-Regular.woff | Bin 16784 -> 16784 bytes assets/fonts/KaTeX_SansSerif-Regular.woff2 | Bin 14004 -> 14024 bytes assets/fonts/KaTeX_Script-Regular.ttf | Bin 24864 -> 24864 bytes assets/fonts/KaTeX_Script-Regular.woff | Bin 13856 -> 13856 bytes assets/fonts/KaTeX_Script-Regular.woff2 | Bin 12268 -> 12276 bytes assets/fonts/KaTeX_Size1-Regular.ttf | Bin 13172 -> 13172 bytes assets/fonts/KaTeX_Size1-Regular.woff | Bin 6980 -> 6980 bytes assets/fonts/KaTeX_Size1-Regular.woff2 | Bin 5812 -> 5824 bytes assets/fonts/KaTeX_Size2-Regular.ttf | Bin 12412 -> 12412 bytes assets/fonts/KaTeX_Size2-Regular.woff | Bin 6684 -> 6684 bytes assets/fonts/KaTeX_Size2-Regular.woff2 | Bin 5560 -> 5560 bytes assets/fonts/KaTeX_Size3-Regular.ttf | Bin 8360 -> 8360 bytes assets/fonts/KaTeX_Size3-Regular.woff | Bin 4776 -> 4776 bytes assets/fonts/KaTeX_Size3-Regular.woff2 | Bin 3860 -> 3856 bytes assets/fonts/KaTeX_Size4-Regular.ttf | Bin 11284 -> 11284 bytes assets/fonts/KaTeX_Size4-Regular.woff | Bin 6456 -> 6456 bytes assets/fonts/KaTeX_Size4-Regular.woff2 | Bin 5132 -> 5184 bytes assets/fonts/KaTeX_Typewriter-Regular.ttf | Bin 36308 -> 36308 bytes assets/fonts/KaTeX_Typewriter-Regular.woff | Bin 20924 -> 20920 bytes assets/fonts/KaTeX_Typewriter-Regular.woff2 | Bin 17536 -> 17540 bytes assets/katex.min.css | 2 +- assets/katex.min.js | 2 +- readme.txt | 98 +- scripts/admin.php | 20 +- scripts/frontend.php | 4 +- wp-katex.php | 2 +- 77 files changed, 658 insertions(+), 909 deletions(-) create mode 100644 .idea/encodings.xml mode change 100644 => 100755 assets/README.md mode change 100644 => 100755 assets/contrib/auto-render.js mode change 100644 => 100755 assets/contrib/auto-render.min.js mode change 100644 => 100755 assets/contrib/copy-tex.css mode change 100644 => 100755 assets/contrib/copy-tex.js mode change 100644 => 100755 assets/contrib/copy-tex.min.css mode change 100644 => 100755 assets/contrib/copy-tex.min.js mode change 100644 => 100755 assets/contrib/mathtex-script-type.js mode change 100644 => 100755 assets/contrib/mathtex-script-type.min.js mode change 100644 => 100755 assets/fonts/KaTeX_AMS-Regular.ttf mode change 100644 => 100755 assets/fonts/KaTeX_AMS-Regular.woff mode change 100644 => 100755 assets/fonts/KaTeX_AMS-Regular.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Caligraphic-Bold.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Caligraphic-Bold.woff mode change 100644 => 100755 assets/fonts/KaTeX_Caligraphic-Bold.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Caligraphic-Regular.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Caligraphic-Regular.woff mode change 100644 => 100755 assets/fonts/KaTeX_Caligraphic-Regular.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Fraktur-Bold.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Fraktur-Bold.woff mode change 100644 => 100755 assets/fonts/KaTeX_Fraktur-Bold.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Fraktur-Regular.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Fraktur-Regular.woff mode change 100644 => 100755 assets/fonts/KaTeX_Fraktur-Regular.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Main-Bold.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Main-Bold.woff mode change 100644 => 100755 assets/fonts/KaTeX_Main-Bold.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Main-BoldItalic.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Main-BoldItalic.woff mode change 100644 => 100755 assets/fonts/KaTeX_Main-BoldItalic.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Main-Italic.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Main-Italic.woff mode change 100644 => 100755 assets/fonts/KaTeX_Main-Italic.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Main-Regular.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Main-Regular.woff mode change 100644 => 100755 assets/fonts/KaTeX_Main-Regular.woff2 create mode 100755 assets/fonts/KaTeX_Math-BoldItalic.ttf create mode 100755 assets/fonts/KaTeX_Math-BoldItalic.woff create mode 100755 assets/fonts/KaTeX_Math-BoldItalic.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Math-Italic.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Math-Italic.woff mode change 100644 => 100755 assets/fonts/KaTeX_Math-Italic.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_SansSerif-Bold.ttf mode change 100644 => 100755 assets/fonts/KaTeX_SansSerif-Bold.woff mode change 100644 => 100755 assets/fonts/KaTeX_SansSerif-Bold.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_SansSerif-Italic.ttf mode change 100644 => 100755 assets/fonts/KaTeX_SansSerif-Italic.woff mode change 100644 => 100755 assets/fonts/KaTeX_SansSerif-Italic.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_SansSerif-Regular.ttf mode change 100644 => 100755 assets/fonts/KaTeX_SansSerif-Regular.woff mode change 100644 => 100755 assets/fonts/KaTeX_SansSerif-Regular.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Script-Regular.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Script-Regular.woff mode change 100644 => 100755 assets/fonts/KaTeX_Script-Regular.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Size1-Regular.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Size1-Regular.woff mode change 100644 => 100755 assets/fonts/KaTeX_Size1-Regular.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Size2-Regular.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Size2-Regular.woff mode change 100644 => 100755 assets/fonts/KaTeX_Size2-Regular.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Size3-Regular.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Size3-Regular.woff mode change 100644 => 100755 assets/fonts/KaTeX_Size3-Regular.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Size4-Regular.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Size4-Regular.woff mode change 100644 => 100755 assets/fonts/KaTeX_Size4-Regular.woff2 mode change 100644 => 100755 assets/fonts/KaTeX_Typewriter-Regular.ttf mode change 100644 => 100755 assets/fonts/KaTeX_Typewriter-Regular.woff mode change 100644 => 100755 assets/fonts/KaTeX_Typewriter-Regular.woff2 mode change 100644 => 100755 assets/katex.min.css mode change 100644 => 100755 assets/katex.min.js diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/README.md b/README.md index e0f0de3..2bd37c3 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ **Donate link:** https://andrewsun.com/donate/ **Tags:** katex, latex, mathjax, math, equation, equations, tex **Requires at least:** 3.9 -**Tested up to:** 4.9 -**Stable tag:** 1.9.1 +**Tested up to:** 5.1 +**Stable tag:** 1.10.0 **Requires PHP:** 5.3 **License:** GPL2 **License URI:** http://www.gnu.org/licenses/gpl-2.0.html @@ -49,6 +49,101 @@ Jetpack has a LaTeX plugin that uses the WordPress.com service to render the equ ## Changelog +### 1.10.0 +* Updated KaTeX library to 0.10.0 + * Added + - Unicode: °, delimiters, 1D400-1D7FF, \ll, \lll, ≘≙≚≛≝≞≟, Unicode Mathematical Alphanumeric Symbols, ⟂ ¬ ⊨ ‼ ∌ ≲ ⩽ ⪅ ≶ ⋚ ⪋, corner, ⟦⟧ (#1203, #1207, #1260, #1273, #1274, #1232, #1377, #1389, #1459, #1750) + - \yen support on text mode (#1208) + - `\(` (#1213) + - Add defineSymbol to the main katex object (#1263) + - Capital Greek letters (#1283, #1285) + - Add version to katex object (#1279, #1475) + - \copyright, \textregistered, \textcircled (#1073) + - Tilde \textasciitilde (#1286) + - Line breaks for inline formulas (#1287) + - \hline (#1306) + - Top-level \newline and `\\` in inline math (#1298) + - Strict mode, unicode text in math mode (#1117, #1278) + - Strict setting for \newline display-mode behavior (#1314) + - Allow all Unicode symbols in nonstrict mode (#1217) + - \tag, \tag*, and \gdef (#1309) + - \def, \gdef, and \global\def (#1348, #1425) + - Change default maxExpand limit to 1000 (#1383) + - \cfrac (#1392) + - \arraystretch as a macro definition (#1381) + - Add ability to create a dashed vertical line in arrays, using ':' (#1395) + - \widecheck (#1406) + - \hdashline (#1407) + - \newcommand, \renewcommand, \providecommand (#1382) + - Add a utility function (setFontMetrics) to extend builtin fontMetrics (#1269) + - \oiint and \oiiint (#1430) + - Remove `match-at` dependency, use RegExp for lexer (#1447) + - \brace and \brack (#1453) + - Allow only allowed protocols in \href (#1440) + - **BREAKING CHANGE:** Only "http", "https", "mailto", and relative URLs are allowed in \href and \url by default. + - \genfrac and \above (#1455, #1458) + - \char character escaping and nicer MathML via \html@mathml (#1454) + - \@binrel (#1487) + - \pmb (#1418) + - 6-digit color without # (#1690) + - \mathnormal (#1700) + - \lparen and \rparen (#1741) + - `\>` (#1752) + * Fixed: + - Fix nested math mode in non-default text mode (#1111) + - Fix contenteditable mode (#1179) + - Work around negative space bug in Chrome (#1194) + - Fix \nobreakspace (#1200) + - Fix instant mode switching for $, \(, \text (#1213) + - Add metrics for \S and \P (#1224) + - Fix anchor.toMarkup (#1246) + - Specify height for SVG elements (#1252) + - Include Bold-Italic fonts for \boldsymbol (#1257) + - Fix space width in \texttt (#1261) + - Fix \underset (#1277) + - Remove special \verb space handling now that space is in Typewriter-Regular (#1258) + - Switch makeGlue from .mord .rule to .mspace (#1295) + - Fix ~ in \verb (#1286) + - Stop throwing ParseError when throwOnError is false (#1169, #1302, #1308) + - Fix extensible arrow sup vertical alignment (#1256) + - Adjust \underset alignment and spacing (#1290) + - Revert frac-lines and \rule to borders (min-height) (#1249, #1417, #1594) + - Fix vertical alignment of \underbrace (#1304) + - Use one strut instead of two (#1307) + - Fix MacroExpander space handling (#1314) + - Cleanup MathML ``, ``, `` (#1338) + - Fix lap vertical alignment. (#1162) + - Fix nested \tfrac (#1370) + - Fix \coloneq etc (#1372) + - Fix wide character spacing (#1371) + - Fix auto-render \\[…] bug (#1375) + - Rewrite spacing commands as macros (#1156) + - Enable output modules to be used in browser or Node (#1401) + - Add vertical kern to \vdots (#1402) + - Implement \neq and \notin via macros like LaTeX's (#1400, #1499) + - Improve \cancel (#1398) + - Fix ligatures vs. \tt (#1379) + - Implement \colon as amsmath does (#1410) + - Automatic mrel/mbin spacing for \boldsymbol (#1388) + - Phantom text (#1449) + - Fix arrowheads for mhchem <--> (#1451) + - Set `documentFragment.style` to empty object (#1471) + - Remove tree cloning before building HTML (#1470) + - Fix \operatorname to support general math functions (#1461) + - Use \not character without left side-bearing correction (#1267) + - Remove codes that require expensive polyfill (#1469, #1563, #1591, #1597) + - Fix \not vertical alignment (#1497) + - Comments without terminating newlines, \href fixes, \url support (#1529) + - Fix \textdaggerdbl (#1539) + - Fix \neq (#1548, #1574) + - Fix wide characters (#1549) + - Fix \fbox (#1550) + - Fix \Large roots (#1485) + - Remove duplicate defineFunction invocation for \mathop (#1701) + - Fix tag positioning to live within katex-html parent (#1721) + - Fix \mathit font and italic correction (#1700) + + ### 1.9.1 * Fix bug causing all equations to show in display style @@ -119,6 +214,7 @@ Jetpack has a LaTeX plugin that uses the WordPress.com service to render the equ - `\llap` and `\rlap` now render contents in math mode. Use `\mathllap` (new) and `\mathrlap` (new) if you need the previous behavior. + ### 1.8.3 * Updated KaTeX library to 0.8.0 * Breaking changes: diff --git a/assets/README.md b/assets/README.md old mode 100644 new mode 100755 index a3396c1..2c0c7a4 --- a/assets/README.md +++ b/assets/README.md @@ -1,7 +1,10 @@ -# [KaTeX](https://khan.github.io/KaTeX/) -[![Build Status](https://travis-ci.org/Khan/KaTeX.svg?branch=master)](https://travis-ci.org/Khan/KaTeX) +# [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) +[![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/) +[![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) KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. @@ -10,126 +13,73 @@ KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the we * **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources. * **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. -KaTeX supports all major browsers, including Chrome, Safari, Firefox, Opera, Edge, and IE 9 - IE 11. More information can be found on the [list of supported commands](https://khan.github.io/KaTeX/function-support.html) and on the [wiki](https://github.com/khan/katex/wiki). +KaTeX is compatible with all major browsers, including Chrome, Safari, Firefox, Opera, Edge, and IE 9–11. -## Usage +KaTeX supports much (but not all) of LaTeX and many LaTeX packages. See the [list of supported functions](https://katex.org/docs/supported.html). -You can [download KaTeX](https://github.com/khan/katex/releases) and host it on your server or include the `katex.min.js` and `katex.min.css` files on your page directly from a CDN: +Try out KaTeX [on the demo page](https://katex.org/#demo)! -```html - - -``` - -#### In-browser rendering +## Getting started -Call `katex.render` with a TeX expression and a DOM element to render into: - -```js -katex.render("c = \\pm\\sqrt{a^2 + b^2}", element); -``` +### Starter template -If KaTeX can't parse the expression, it throws a `katex.ParseError` error. - -#### Server side rendering or rendering to a string - -To generate HTML on the server or to generate an HTML string of the rendered math, you can use `katex.renderToString`: - -```js -var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}"); -// '...' +```html + + + + + + + + + + + + + ... + ``` -Make sure to include the CSS and font files, but there is no need to include the JavaScript. Like `render`, `renderToString` throws if it can't parse the expression. - -#### Security - -Any HTML generated by KaTeX *should* be safe from `