katex 0.16.26 → 0.16.28

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
@@ -12544,13 +12544,18 @@ defineFunction({
12544
12544
  var data = value.split(",");
12545
12545
 
12546
12546
  for (var i = 0; i < data.length; i++) {
12547
- var keyVal = data[i].split("=");
12547
+ var item = data[i];
12548
+ var firstEquals = item.indexOf("=");
12548
12549
 
12549
- if (keyVal.length !== 2) {
12550
- throw new ParseError("Error parsing key-value for \\htmlData");
12550
+ if (firstEquals < 0) {
12551
+ throw new ParseError("\\htmlData key/value '" + item + "'" + " missing equals sign");
12551
12552
  }
12552
12553
 
12553
- attributes["data-" + keyVal[0].trim()] = keyVal[1].trim();
12554
+ var key = item.slice(0, firstEquals);
12555
+
12556
+ var _value = item.slice(firstEquals + 1);
12557
+
12558
+ attributes["data-" + key.trim()] = _value;
12554
12559
  }
12555
12560
 
12556
12561
  trustContext = {
@@ -17345,7 +17350,7 @@ class Parser {
17345
17350
  * Parses an "expression", which is a list of atoms.
17346
17351
  *
17347
17352
  * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
17348
- * happens when functions have higher precedence han infix
17353
+ * happens when functions have higher precedence than infix
17349
17354
  * nodes in implicit parses.
17350
17355
  *
17351
17356
  * `breakOnTokenText`: The text of the token that the expression should end
@@ -18438,7 +18443,7 @@ var renderToHTMLTree = function renderToHTMLTree(expression, options) {
18438
18443
  }
18439
18444
  };
18440
18445
 
18441
- var version = "0.16.26";
18446
+ var version = "0.16.28";
18442
18447
  var __domTree = {
18443
18448
  Span,
18444
18449
  Anchor,
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "katex",
3
- "version": "0.16.26",
3
+ "version": "0.16.28",
4
4
  "description": "Fast math typesetting for the web.",
5
5
  "main": "dist/katex.js",
6
+ "types": "types/katex.d.ts",
6
7
  "exports": {
7
8
  ".": {
8
9
  "require": {
package/src/Parser.js CHANGED
@@ -178,7 +178,7 @@ export default class Parser {
178
178
  * Parses an "expression", which is a list of atoms.
179
179
  *
180
180
  * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
181
- * happens when functions have higher precedence han infix
181
+ * happens when functions have higher precedence than infix
182
182
  * nodes in implicit parses.
183
183
  *
184
184
  * `breakOnTokenText`: The text of the token that the expression should end
@@ -52,12 +52,15 @@ defineFunction({
52
52
  case "\\htmlData": {
53
53
  const data = value.split(",");
54
54
  for (let i = 0; i < data.length; i++) {
55
- const keyVal = data[i].split("=");
56
- if (keyVal.length !== 2) {
57
- throw new ParseError(
58
- "Error parsing key-value for \\htmlData");
55
+ const item = data[i];
56
+ const firstEquals = item.indexOf("=");
57
+ if (firstEquals < 0) {
58
+ throw new ParseError(`\\htmlData key/value '${item}'` +
59
+ ` missing equals sign`);
59
60
  }
60
- attributes["data-" + keyVal[0].trim()] = keyVal[1].trim();
61
+ const key = item.slice(0, firstEquals);
62
+ const value = item.slice(firstEquals + 1);
63
+ attributes["data-" + key.trim()] = value;
61
64
  }
62
65
 
63
66
  trustContext = {