katex 0.16.5 → 0.16.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/contrib/auto-render/test/auto-render-spec.js +1 -1
- package/contrib/copy-tex/README.md +2 -2
- package/contrib/mathtex-script-type/README.md +5 -5
- package/contrib/mhchem/README.md +1 -1
- package/contrib/mhchem/mhchem.js +2 -2
- package/contrib/render-a11y-string/render-a11y-string.js +1 -1
- package/dist/README.md +3 -3
- package/dist/contrib/mhchem.js +2 -2
- package/dist/contrib/mhchem.mjs +1 -1
- package/dist/contrib/render-a11y-string.js +1 -1
- package/dist/contrib/render-a11y-string.mjs +1 -1
- package/dist/katex.css +1 -1
- package/dist/katex.js +91 -90
- package/dist/katex.min.css +1 -1
- package/dist/katex.min.js +1 -1
- package/dist/katex.mjs +91 -90
- package/package.json +1 -1
- package/src/MacroExpander.js +21 -22
- package/src/Parser.js +1 -1
- package/src/buildMathML.js +2 -2
- package/src/defineEnvironment.js +1 -1
- package/src/defineMacro.js +1 -1
- package/src/delimiter.js +20 -20
- package/src/environments/array.js +2 -2
- package/src/fontMetrics.js +4 -4
- package/src/functions/arrow.js +1 -1
- package/src/functions/delimsizing.js +1 -1
- package/src/katex.less +1 -1
- package/src/mathMLTree.js +2 -2
- package/src/parseNode.js +1 -1
- package/src/svgGeometry.js +51 -51
package/README.md
CHANGED
|
@@ -31,13 +31,13 @@ Try out KaTeX [on the demo page](https://katex.org/#demo)!
|
|
|
31
31
|
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
|
|
32
32
|
<html>
|
|
33
33
|
<head>
|
|
34
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
34
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/katex.min.css" integrity="sha384-3UiQGuEI4TTMaFmGIZumfRPtfKQ3trwQE2JgosJxCnGmQpL/lJdjpcHkaaFwHlcI" crossorigin="anonymous">
|
|
35
35
|
|
|
36
36
|
<!-- The loading of KaTeX is deferred to speed up page rendering -->
|
|
37
|
-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
37
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/katex.min.js" integrity="sha384-G0zcxDFp5LWZtDuRMnBkk3EphCK1lhEf4UEyEM693ka574TZGwo4IWwS6QLzM/2t" crossorigin="anonymous"></script>
|
|
38
38
|
|
|
39
39
|
<!-- To automatically render math in text elements, include the auto-render extension: -->
|
|
40
|
-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
40
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
|
|
41
41
|
onload="renderMathInElement(document.body);"></script>
|
|
42
42
|
</head>
|
|
43
43
|
...
|
|
@@ -127,7 +127,7 @@ describe("A delimiter splitter", function() {
|
|
|
127
127
|
]);
|
|
128
128
|
});
|
|
129
129
|
|
|
130
|
-
it("splits
|
|
130
|
+
it("splits multiple times", function() {
|
|
131
131
|
expect("hello ( world ) boo ( more ) stuff").toSplitInto(
|
|
132
132
|
[
|
|
133
133
|
{type: "text", data: "hello "},
|
|
@@ -18,7 +18,7 @@ This extension isn't part of KaTeX proper, so the script should be separately
|
|
|
18
18
|
included in the page.
|
|
19
19
|
|
|
20
20
|
```html
|
|
21
|
-
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
21
|
+
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/contrib/copy-tex.min.js" integrity="sha384-ww/583aHhxWkz5DEVn6OKtNiIaLi2iBRNZXfJRiY1Ai7tnJ9UXpEsyvOITVpTl4A" crossorigin="anonymous"></script>
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
(Note that, as of KaTeX 0.16.0, there is no longer a corresponding CSS file.)
|
|
@@ -35,5 +35,5 @@ statement with `require('katex/contrib/copy-tex/katex2tex.js')`.
|
|
|
35
35
|
|
|
36
36
|
ECMAScript module is also available:
|
|
37
37
|
```html
|
|
38
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
38
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/contrib/copy-tex.mjs" integrity="sha384-bVEnwt0PtX+1EuJoOEcm4rgTUWvb2ILTdjHfI1gUe/r5fdqrTcQaUuRdHG2DciuQ" crossorigin="anonymous"></script>
|
|
39
39
|
```
|
|
@@ -11,7 +11,7 @@ included in the page, in addition to KaTeX.
|
|
|
11
11
|
Load the extension by adding the following line to your HTML file.
|
|
12
12
|
|
|
13
13
|
```html
|
|
14
|
-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
14
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/contrib/mathtex-script-type.min.js" integrity="sha384-jiBVvJ8NGGj5n7kJaiWwWp9AjC+Yh8rhZY3GtAX8yU28azcLgoRo4oukO87g7zDT" crossorigin="anonymous"></script>
|
|
15
15
|
```
|
|
16
16
|
You can download the script and use it locally, or from a local KaTeX installation instead.
|
|
17
17
|
|
|
@@ -23,9 +23,9 @@ Then, in the body, we use a `math/tex` script to typeset the equation `x+\sqrt{1
|
|
|
23
23
|
<!DOCTYPE html>
|
|
24
24
|
<html>
|
|
25
25
|
<head>
|
|
26
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
27
|
-
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
28
|
-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
26
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/katex.min.css" integrity="sha384-3UiQGuEI4TTMaFmGIZumfRPtfKQ3trwQE2JgosJxCnGmQpL/lJdjpcHkaaFwHlcI" crossorigin="anonymous">
|
|
27
|
+
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/katex.min.js" integrity="sha384-G0zcxDFp5LWZtDuRMnBkk3EphCK1lhEf4UEyEM693ka574TZGwo4IWwS6QLzM/2t" crossorigin="anonymous"></script>
|
|
28
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/contrib/mathtex-script-type.min.js" integrity="sha384-jiBVvJ8NGGj5n7kJaiWwWp9AjC+Yh8rhZY3GtAX8yU28azcLgoRo4oukO87g7zDT" crossorigin="anonymous"></script>
|
|
29
29
|
</head>
|
|
30
30
|
<body>
|
|
31
31
|
<script type="math/tex">x+\sqrt{1-x^2}</script>
|
|
@@ -35,4 +35,4 @@ Then, in the body, we use a `math/tex` script to typeset the equation `x+\sqrt{1
|
|
|
35
35
|
|
|
36
36
|
ECMAScript module is also available:
|
|
37
37
|
```html
|
|
38
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
38
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/contrib/mathtex-script-type.mjs" integrity="sha384-4EJvC5tvqq9XJxXvdD4JutBokuFw/dCe2AB4gZ9sRpwFFXECpL3qT43tmE0PkpVg" crossorigin="anonymous"></script>
|
package/contrib/mhchem/README.md
CHANGED
|
@@ -7,7 +7,7 @@ This extension adds to KaTeX the `\ce` and `\pu` functions from the [mhchem](htt
|
|
|
7
7
|
This extension isn't part of core KaTeX, so the script should be separately included. Write the following line into the HTML page's `<head>`. Place it *after* the line that calls `katex.js`, and if you make use of the [auto-render](https://katex.org/docs/autorender.html) extension, place it *before* the line that calls `auto-render.js`.
|
|
8
8
|
|
|
9
9
|
```html
|
|
10
|
-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
10
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/contrib/mhchem.min.js" integrity="sha384-ifpG+NlgMq0kvOSGqGQxW1mJKpjjMDmZdpKGq3tbvD3WPhyshCEEYClriK/wRVU0" crossorigin="anonymous"></script>
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
If you remove the `defer` attribute from this tag, then you must also remove the `defer` attribute from the `<script src="https://../katex.min.js">` tag.
|
package/contrib/mhchem/mhchem.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
/* -*- Mode:
|
|
2
|
+
/* -*- Mode: JavaScript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
|
3
3
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
4
4
|
|
|
5
5
|
/*************************************************************
|
|
@@ -1686,7 +1686,7 @@ import katex from "katex";
|
|
|
1686
1686
|
};
|
|
1687
1687
|
|
|
1688
1688
|
//
|
|
1689
|
-
// Helpers for code
|
|
1689
|
+
// Helpers for code analysis
|
|
1690
1690
|
// Will show type error at calling position
|
|
1691
1691
|
//
|
|
1692
1692
|
/** @param {number} a */
|
|
@@ -670,7 +670,7 @@ const handleObject = (
|
|
|
670
670
|
}
|
|
671
671
|
|
|
672
672
|
case "mathchoice": {
|
|
673
|
-
// TODO: track which
|
|
673
|
+
// TODO: track which style we're using, e.g. display, text, etc.
|
|
674
674
|
// default to text style if even that may not be the correct style
|
|
675
675
|
buildA11yStrings(tree.text, a11yStrings, atomType);
|
|
676
676
|
break;
|
package/dist/README.md
CHANGED
|
@@ -31,13 +31,13 @@ Try out KaTeX [on the demo page](https://katex.org/#demo)!
|
|
|
31
31
|
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
|
|
32
32
|
<html>
|
|
33
33
|
<head>
|
|
34
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
34
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/katex.min.css" integrity="sha384-3UiQGuEI4TTMaFmGIZumfRPtfKQ3trwQE2JgosJxCnGmQpL/lJdjpcHkaaFwHlcI" crossorigin="anonymous">
|
|
35
35
|
|
|
36
36
|
<!-- The loading of KaTeX is deferred to speed up page rendering -->
|
|
37
|
-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
37
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/katex.min.js" integrity="sha384-G0zcxDFp5LWZtDuRMnBkk3EphCK1lhEf4UEyEM693ka574TZGwo4IWwS6QLzM/2t" crossorigin="anonymous"></script>
|
|
38
38
|
|
|
39
39
|
<!-- To automatically render math in text elements, include the auto-render extension: -->
|
|
40
|
-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.
|
|
40
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
|
|
41
41
|
onload="renderMathInElement(document.body);"></script>
|
|
42
42
|
</head>
|
|
43
43
|
...
|
package/dist/contrib/mhchem.js
CHANGED
|
@@ -83,7 +83,7 @@ var __webpack_exports__ = {};
|
|
|
83
83
|
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__);
|
|
84
84
|
/* eslint-disable */
|
|
85
85
|
|
|
86
|
-
/* -*- Mode:
|
|
86
|
+
/* -*- Mode: JavaScript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
|
|
87
87
|
|
|
88
88
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
89
89
|
|
|
@@ -3197,7 +3197,7 @@ var texify = {
|
|
|
3197
3197
|
}
|
|
3198
3198
|
}
|
|
3199
3199
|
}; //
|
|
3200
|
-
// Helpers for code
|
|
3200
|
+
// Helpers for code analysis
|
|
3201
3201
|
// Will show type error at calling position
|
|
3202
3202
|
//
|
|
3203
3203
|
|
package/dist/contrib/mhchem.mjs
CHANGED
|
@@ -801,7 +801,7 @@ var handleObject = function handleObject(tree, a11yStrings, atomType) {
|
|
|
801
801
|
|
|
802
802
|
case "mathchoice":
|
|
803
803
|
{
|
|
804
|
-
// TODO: track which
|
|
804
|
+
// TODO: track which style we're using, e.g. display, text, etc.
|
|
805
805
|
// default to text style if even that may not be the correct style
|
|
806
806
|
buildA11yStrings(tree.text, a11yStrings, atomType);
|
|
807
807
|
break;
|
|
@@ -726,7 +726,7 @@ var handleObject = (tree, a11yStrings, atomType) => {
|
|
|
726
726
|
|
|
727
727
|
case "mathchoice":
|
|
728
728
|
{
|
|
729
|
-
// TODO: track which
|
|
729
|
+
// TODO: track which style we're using, e.g. display, text, etc.
|
|
730
730
|
// default to text style if even that may not be the correct style
|
|
731
731
|
buildA11yStrings(tree.text, a11yStrings, atomType);
|
|
732
732
|
break;
|