katex 0.16.3 → 0.16.5

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/dist/katex.mjs CHANGED
@@ -8549,8 +8549,7 @@ defineFunction({
8549
8549
  names: ["\\\\"],
8550
8550
  props: {
8551
8551
  numArgs: 0,
8552
- numOptionalArgs: 1,
8553
- argTypes: ["size"],
8552
+ numOptionalArgs: 0,
8554
8553
  allowedInText: true
8555
8554
  },
8556
8555
 
@@ -8558,7 +8557,7 @@ defineFunction({
8558
8557
  var {
8559
8558
  parser
8560
8559
  } = _ref;
8561
- var size = optArgs[0];
8560
+ var size = parser.gullet.future().text === "[" ? parser.parseSizeGroup(true) : null;
8562
8561
  var newLine = !parser.settings.displayMode || !parser.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline " + "does nothing in display mode");
8563
8562
  return {
8564
8563
  type: "cr",
@@ -18297,7 +18296,7 @@ var katex = {
18297
18296
  /**
18298
18297
  * Current KaTeX version
18299
18298
  */
18300
- version: "0.16.3",
18299
+ version: "0.16.5",
18301
18300
 
18302
18301
  /**
18303
18302
  * Renders the given LaTeX into an HTML+MathML combination, and adds
@@ -18362,6 +18361,13 @@ var katex = {
18362
18361
  */
18363
18362
  __defineSymbol: defineSymbol,
18364
18363
 
18364
+ /**
18365
+ * adds a new function to builtin function list,
18366
+ * which directly produce parse tree elements
18367
+ * and have their own html/mathml builders
18368
+ */
18369
+ __defineFunction: defineFunction,
18370
+
18365
18371
  /**
18366
18372
  * adds a new macro to builtin macro list
18367
18373
  */
package/katex.js CHANGED
@@ -28,6 +28,7 @@ import type {AnyParseNode} from "./src/parseNode";
28
28
  import type {DomSpan} from "./src/domTree";
29
29
 
30
30
  import {defineSymbol} from './src/symbols';
31
+ import defineFunction from './src/defineFunction';
31
32
  import defineMacro from './src/defineMacro';
32
33
  import {setFontMetrics} from './src/fontMetrics';
33
34
 
@@ -196,6 +197,12 @@ export default {
196
197
  * adds a new symbol to builtin symbols table
197
198
  */
198
199
  __defineSymbol: defineSymbol,
200
+ /**
201
+ * adds a new function to builtin function list,
202
+ * which directly produce parse tree elements
203
+ * and have their own html/mathml builders
204
+ */
205
+ __defineFunction: defineFunction,
199
206
  /**
200
207
  * adds a new macro to builtin macro list
201
208
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "katex",
3
- "version": "0.16.3",
3
+ "version": "0.16.5",
4
4
  "description": "Fast math typesetting for the web.",
5
5
  "main": "dist/katex.js",
6
6
  "exports": {
@@ -49,78 +49,79 @@
49
49
  "license": "MIT",
50
50
  "packageManager": "yarn@3.2.2",
51
51
  "devDependencies": {
52
- "@babel/core": "^7.10.4",
53
- "@babel/eslint-parser": "^7.15.0",
54
- "@babel/plugin-proposal-class-properties": "^7.10.4",
55
- "@babel/plugin-syntax-flow": "^7.14.5",
56
- "@babel/plugin-transform-react-jsx": "^7.14.9",
57
- "@babel/plugin-transform-runtime": "^7.10.4",
58
- "@babel/preset-env": "^7.10.4",
59
- "@babel/preset-flow": "^7.10.4",
60
- "@babel/preset-react": "^7.14.5",
61
- "@babel/register": "^7.10.4",
62
- "@babel/runtime": "^7.10.4",
63
- "@rollup/plugin-alias": "^3.1.1",
64
- "@rollup/plugin-babel": "^5.0.4",
65
- "@semantic-release/changelog": "^6.0.0",
66
- "@semantic-release/git": "^10.0.0",
67
- "babel-jest": "^27.0.0",
68
- "babel-loader": "^8.0.5",
69
- "babel-plugin-istanbul": "^6.0.0",
70
- "babel-plugin-preval": "^5.0.0",
52
+ "@babel/core": "^7.18.13",
53
+ "@babel/eslint-parser": "^7.18.9",
54
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
55
+ "@babel/plugin-syntax-flow": "^7.18.6",
56
+ "@babel/plugin-transform-react-jsx": "^7.18.10",
57
+ "@babel/plugin-transform-runtime": "^7.18.10",
58
+ "@babel/preset-env": "^7.18.10",
59
+ "@babel/preset-flow": "^7.18.6",
60
+ "@babel/preset-react": "^7.18.6",
61
+ "@babel/register": "^7.18.9",
62
+ "@babel/runtime": "^7.18.9",
63
+ "@rollup/plugin-alias": "^3.1.9",
64
+ "@rollup/plugin-babel": "^5.3.1",
65
+ "@semantic-release/changelog": "^6.0.1",
66
+ "@semantic-release/git": "^10.0.1",
67
+ "babel-jest": "^29.0.1",
68
+ "babel-loader": "^8.2.5",
69
+ "babel-plugin-istanbul": "^6.1.1",
70
+ "babel-plugin-preval": "^5.1.0",
71
71
  "babel-plugin-version-inline": "^1.0.0",
72
72
  "benchmark": "^2.1.4",
73
- "browserslist": "^4.13.0",
74
- "browserstack-local": "^1.4.5",
75
- "caniuse-lite": "^1.0.30001102",
76
- "css-loader": "^6.0.0",
77
- "cssnano": "^5.0.0-rc.1",
78
- "eslint": "^8.0.0",
73
+ "browserslist": "^4.21.3",
74
+ "browserstack-local": "^1.5.1",
75
+ "caniuse-lite": "^1.0.30001384",
76
+ "css-loader": "^6.7.1",
77
+ "cssnano": "^5.1.13",
78
+ "eslint": "^8.23.0",
79
79
  "eslint-import-resolver-webpack": "^0.13.2",
80
80
  "eslint-plugin-actions": "^2.0.0",
81
- "eslint-plugin-flowtype": "^8.0.0",
82
- "eslint-plugin-import": "^2.25.2",
83
- "eslint-plugin-react": "^7.20.3",
81
+ "eslint-plugin-flowtype": "^8.0.3",
82
+ "eslint-plugin-import": "^2.26.0",
83
+ "eslint-plugin-react": "^7.31.1",
84
84
  "flow-bin": "^0.135.0",
85
- "fs-extra": "^10.0.0",
86
- "got": "^11.8.0",
87
- "husky": "^4.2.5",
88
- "istanbul-lib-coverage": "^3.0.0",
85
+ "fs-extra": "^10.1.0",
86
+ "got": "^11.8.5",
87
+ "husky": "^4.3.8",
88
+ "istanbul-lib-coverage": "^3.2.0",
89
89
  "istanbul-lib-report": "^3.0.0",
90
- "istanbul-reports": "^3.0.2",
91
- "jest": "^27.0.0",
92
- "jest-diff": "^27.0.0",
93
- "jest-matcher-utils": "^27.0.0",
94
- "jest-message-util": "^27.0.0",
95
- "jest-serializer-html": "^7.0.0",
96
- "js-yaml": "^4.0.0",
90
+ "istanbul-reports": "^3.1.5",
91
+ "jest": "^29.0.1",
92
+ "jest-diff": "^29.0.1",
93
+ "jest-environment-jsdom": "^29.0.1",
94
+ "jest-matcher-utils": "^29.0.1",
95
+ "jest-message-util": "^29.0.1",
96
+ "jest-serializer-html": "^7.1.0",
97
+ "js-yaml": "^4.1.0",
97
98
  "json-stable-stringify": "^1.0.1",
98
99
  "jspngopt": "^0.2.0",
99
- "less": "^4.0.0",
100
- "less-loader": "^10.0.0",
101
- "mini-css-extract-plugin": "^2.0.0",
100
+ "less": "^4.1.3",
101
+ "less-loader": "^11.0.0",
102
+ "mini-css-extract-plugin": "^2.6.1",
102
103
  "mkdirp": "^1.0.4",
103
- "p-retry": "^4.6.1",
104
- "pako": "^2.0.0",
105
- "postcss": "^8.0.0",
104
+ "p-retry": "^4.6.2",
105
+ "pako": "^2.0.4",
106
+ "postcss": "^8.4.16",
106
107
  "postcss-less": "^6.0.0",
107
- "postcss-loader": "^6.0.0",
108
- "postcss-preset-env": "^7.0.0",
109
- "prettier": "^2.0.5",
110
- "query-string": "^7.0.0",
108
+ "postcss-loader": "^7.0.1",
109
+ "postcss-preset-env": "^7.8.0",
110
+ "prettier": "^2.7.1",
111
+ "query-string": "^7.1.1",
111
112
  "rimraf": "^3.0.2",
112
- "rollup": "^2.21.0",
113
- "selenium-webdriver": "^4.0.0-beta.4",
114
- "semantic-release": "^18.0.0",
113
+ "rollup": "^2.78.1",
114
+ "selenium-webdriver": "^4.4.0",
115
+ "semantic-release": "^19.0.5",
115
116
  "sri-toolbox": "^0.2.0",
116
- "style-loader": "^3.0.0",
117
- "stylelint": "^14.0.0",
118
- "stylelint-config-standard": "^24.0.0",
119
- "terser-webpack-plugin": "^5.0.3",
120
- "webpack": "^5.51.1",
121
- "webpack-bundle-analyzer": "^4.0.0",
122
- "webpack-cli": "^4.8.0",
123
- "webpack-dev-server": "^4.0.0"
117
+ "style-loader": "^3.3.1",
118
+ "stylelint": "^14.11.0",
119
+ "stylelint-config-standard": "^28.0.0",
120
+ "terser-webpack-plugin": "^5.3.6",
121
+ "webpack": "^5.74.0",
122
+ "webpack-bundle-analyzer": "^4.6.1",
123
+ "webpack-cli": "^4.10.0",
124
+ "webpack-dev-server": "^4.10.1"
124
125
  },
125
126
  "bin": "cli.js",
126
127
  "scripts": {
@@ -150,7 +151,7 @@
150
151
  "dist:zip": "rimraf katex/ katex.tar.gz katex.zip && cp -R dist katex && tar czf katex.tar.gz katex && zip -rq katex.zip katex && rimraf katex/"
151
152
  },
152
153
  "dependencies": {
153
- "commander": "^8.0.0"
154
+ "commander": "^8.3.0"
154
155
  },
155
156
  "husky": {
156
157
  "hooks": {
@@ -173,7 +174,9 @@
173
174
  "testMatch": [
174
175
  "**/test/*-spec.js"
175
176
  ],
176
- "testURL": "http://localhost/",
177
+ "testEnvironmentOptions": {
178
+ "url": "http://localhost/"
179
+ },
177
180
  "transform": {
178
181
  "^.+\\.js$": "babel-jest"
179
182
  },
@@ -13,13 +13,13 @@ defineFunction({
13
13
  names: ["\\\\"],
14
14
  props: {
15
15
  numArgs: 0,
16
- numOptionalArgs: 1,
17
- argTypes: ["size"],
16
+ numOptionalArgs: 0,
18
17
  allowedInText: true,
19
18
  },
20
19
 
21
20
  handler({parser}, args, optArgs) {
22
- const size = optArgs[0];
21
+ const size = parser.gullet.future().text === "[" ?
22
+ parser.parseSizeGroup(true) : null;
23
23
  const newLine = !parser.settings.displayMode ||
24
24
  !parser.settings.useStrictBehavior(
25
25
  "newLineInDisplayMode", "In LaTeX, \\\\ or \\newline " +