katex 0.16.4 → 0.16.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "katex",
3
- "version": "0.16.4",
3
+ "version": "0.16.6",
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
  },
@@ -249,22 +249,22 @@ export default class MacroExpander implements MacroContextInterface {
249
249
  * Expand the next token only once if possible.
250
250
  *
251
251
  * If the token is expanded, the resulting tokens will be pushed onto
252
- * the stack in reverse order and will be returned as an array,
253
- * also in reverse order.
252
+ * the stack in reverse order, and the number of such tokens will be
253
+ * returned. This number might be zero or positive.
254
254
  *
255
- * If not, the next token will be returned without removing it
256
- * from the stack. This case can be detected by a `Token` return value
257
- * instead of an `Array` return value.
255
+ * If not, the return value is `false`, and the next token remains at the
256
+ * top of the stack.
258
257
  *
259
258
  * In either case, the next token will be on the top of the stack,
260
- * or the stack will be empty.
259
+ * or the stack will be empty (in case of empty expansion
260
+ * and no other tokens).
261
261
  *
262
262
  * Used to implement `expandAfterFuture` and `expandNextToken`.
263
263
  *
264
264
  * If expandableOnly, only expandable tokens are expanded and
265
265
  * an undefined control sequence results in an error.
266
266
  */
267
- expandOnce(expandableOnly?: boolean): Token | Token[] {
267
+ expandOnce(expandableOnly?: boolean): number | boolean {
268
268
  const topToken = this.popToken();
269
269
  const name = topToken.text;
270
270
  const expansion = !topToken.noexpand ? this._getExpansion(name) : null;
@@ -274,7 +274,7 @@ export default class MacroExpander implements MacroContextInterface {
274
274
  throw new ParseError("Undefined control sequence: " + name);
275
275
  }
276
276
  this.pushToken(topToken);
277
- return topToken;
277
+ return false;
278
278
  }
279
279
  this.expansionCount++;
280
280
  if (this.expansionCount > this.settings.maxExpand) {
@@ -310,7 +310,7 @@ export default class MacroExpander implements MacroContextInterface {
310
310
  }
311
311
  // Concatenate expansion onto top of stack.
312
312
  this.pushTokens(tokens);
313
- return tokens;
313
+ return tokens.length;
314
314
  }
315
315
 
316
316
  /**
@@ -329,15 +329,14 @@ export default class MacroExpander implements MacroContextInterface {
329
329
  */
330
330
  expandNextToken(): Token {
331
331
  for (;;) {
332
- const expanded = this.expandOnce();
333
- // expandOnce returns Token if and only if it's fully expanded.
334
- if (expanded instanceof Token) {
332
+ if (this.expandOnce() === false) { // fully expanded
333
+ const token = this.stack.pop();
335
334
  // the token after \noexpand is interpreted as if its meaning
336
335
  // were ‘\relax’
337
- if (expanded.treatAsRelax) {
338
- expanded.text = "\\relax";
336
+ if (token.treatAsRelax) {
337
+ token.text = "\\relax";
339
338
  }
340
- return this.stack.pop(); // === expanded
339
+ return token;
341
340
  }
342
341
  }
343
342
 
@@ -365,15 +364,15 @@ export default class MacroExpander implements MacroContextInterface {
365
364
  const oldStackLength = this.stack.length;
366
365
  this.pushTokens(tokens);
367
366
  while (this.stack.length > oldStackLength) {
368
- const expanded = this.expandOnce(true); // expand only expandable tokens
369
- // expandOnce returns Token if and only if it's fully expanded.
370
- if (expanded instanceof Token) {
371
- if (expanded.treatAsRelax) {
367
+ // Expand only expandable tokens
368
+ if (this.expandOnce(true) === false) { // fully expanded
369
+ const token = this.stack.pop();
370
+ if (token.treatAsRelax) {
372
371
  // the expansion of \noexpand is the token itself
373
- expanded.noexpand = false;
374
- expanded.treatAsRelax = false;
372
+ token.noexpand = false;
373
+ token.treatAsRelax = false;
375
374
  }
376
- output.push(this.stack.pop());
375
+ output.push(token);
377
376
  }
378
377
  }
379
378
  return output;
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 precendence han infix
181
+ * happens when functions have higher precedence han infix
182
182
  * nodes in implicit parses.
183
183
  *
184
184
  * `breakOnTokenText`: The text of the token that the expression should end
@@ -1,6 +1,6 @@
1
1
  // @flow
2
2
  /**
3
- * This file converts a parse tree into a cooresponding MathML tree. The main
3
+ * This file converts a parse tree into a corresponding MathML tree. The main
4
4
  * entry point is the `buildMathML` function, which takes a parse tree from the
5
5
  * parser.
6
6
  */
@@ -101,7 +101,7 @@ export const getVariant = function(
101
101
  } else if (font === "mathfrak") {
102
102
  return "fraktur";
103
103
  } else if (font === "mathscr" || font === "mathcal") {
104
- // MathML makes no distinction between script and caligrahpic
104
+ // MathML makes no distinction between script and calligraphic
105
105
  return "script";
106
106
  } else if (font === "mathsf") {
107
107
  return "sans-serif";
@@ -42,7 +42,7 @@ type EnvProps = {
42
42
  };
43
43
 
44
44
  /**
45
- * Final enviornment spec for use at parse time.
45
+ * Final environment spec for use at parse time.
46
46
  * This is almost identical to `EnvDefSpec`, except it
47
47
  * 1. includes the function handler
48
48
  * 2. requires all arguments except argType
@@ -35,7 +35,7 @@ export interface MacroContextInterface {
35
35
  /**
36
36
  * Expand the next token only once if possible.
37
37
  */
38
- expandOnce(expandableOnly?: boolean): Token | Token[];
38
+ expandOnce(expandableOnly?: boolean): number | boolean;
39
39
 
40
40
  /**
41
41
  * Expand the next token only once (if possible), and return the resulting
package/src/delimiter.js CHANGED
@@ -364,7 +364,7 @@ const makeStackedDelim = function(
364
364
  middleFactor = 2; // repeat symmetrically above and below middle
365
365
  }
366
366
 
367
- // Calcuate the minimal height that the delimiter can have.
367
+ // Calculate the minimal height that the delimiter can have.
368
368
  // It is at least the size of the top, bottom, and optional middle combined.
369
369
  const minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal;
370
370
 
@@ -453,7 +453,7 @@ const makeStackedDelim = function(
453
453
  Style.TEXT, options, classes);
454
454
  };
455
455
 
456
- // All surds have 0.08em padding above the viniculum inside the SVG.
456
+ // All surds have 0.08em padding above the vinculum inside the SVG.
457
457
  // That keeps browser span height rounding error from pinching the line.
458
458
  const vbPad = 80; // padding above the surd, measured inside the viewBox.
459
459
  const emPad = 0.08; // padding, in ems, measured in the document.
@@ -462,10 +462,10 @@ const sqrtSvg = function(
462
462
  sqrtName: string,
463
463
  height: number,
464
464
  viewBoxHeight: number,
465
- extraViniculum: number,
465
+ extraVinculum: number,
466
466
  options: Options,
467
467
  ): SvgSpan {
468
- const path = sqrtPath(sqrtName, extraViniculum, viewBoxHeight);
468
+ const path = sqrtPath(sqrtName, extraVinculum, viewBoxHeight);
469
469
  const pathNode = new PathNode(sqrtName, path);
470
470
 
471
471
  const svg = new SvgNode([pathNode], {
@@ -500,9 +500,9 @@ const makeSqrtImage = function(
500
500
 
501
501
  let sizeMultiplier = newOptions.sizeMultiplier; // default
502
502
 
503
- // The standard sqrt SVGs each have a 0.04em thick viniculum.
504
- // If Settings.minRuleThickness is larger than that, we add extraViniculum.
505
- const extraViniculum = Math.max(0,
503
+ // The standard sqrt SVGs each have a 0.04em thick vinculum.
504
+ // If Settings.minRuleThickness is larger than that, we add extraVinculum.
505
+ const extraVinculum = Math.max(0,
506
506
  options.minRuleThickness - options.fontMetrics().sqrtRuleThickness);
507
507
 
508
508
  // Create a span containing an SVG image of a sqrt symbol.
@@ -514,22 +514,22 @@ const makeSqrtImage = function(
514
514
 
515
515
  // We create viewBoxes with 80 units of "padding" above each surd.
516
516
  // Then browser rounding error on the parent span height will not
517
- // encroach on the ink of the viniculum. But that padding is not
517
+ // encroach on the ink of the vinculum. But that padding is not
518
518
  // included in the TeX-like `height` used for calculation of
519
519
  // vertical alignment. So texHeight = span.height < span.style.height.
520
520
 
521
521
  if (delim.type === "small") {
522
522
  // Get an SVG that is derived from glyph U+221A in font KaTeX-Main.
523
523
  // 1000 unit normal glyph height.
524
- viewBoxHeight = 1000 + 1000 * extraViniculum + vbPad;
524
+ viewBoxHeight = 1000 + 1000 * extraVinculum + vbPad;
525
525
  if (height < 1.0) {
526
526
  sizeMultiplier = 1.0; // mimic a \textfont radical
527
527
  } else if (height < 1.4) {
528
528
  sizeMultiplier = 0.7; // mimic a \scriptfont radical
529
529
  }
530
- spanHeight = (1.0 + extraViniculum + emPad) / sizeMultiplier;
531
- texHeight = (1.00 + extraViniculum) / sizeMultiplier;
532
- span = sqrtSvg("sqrtMain", spanHeight, viewBoxHeight, extraViniculum,
530
+ spanHeight = (1.0 + extraVinculum + emPad) / sizeMultiplier;
531
+ texHeight = (1.00 + extraVinculum) / sizeMultiplier;
532
+ span = sqrtSvg("sqrtMain", spanHeight, viewBoxHeight, extraVinculum,
533
533
  options);
534
534
  span.style.minWidth = "0.853em";
535
535
  advanceWidth = 0.833 / sizeMultiplier; // from the font.
@@ -537,21 +537,21 @@ const makeSqrtImage = function(
537
537
  } else if (delim.type === "large") {
538
538
  // These SVGs come from fonts: KaTeX_Size1, _Size2, etc.
539
539
  viewBoxHeight = (1000 + vbPad) * sizeToMaxHeight[delim.size];
540
- texHeight = (sizeToMaxHeight[delim.size] + extraViniculum) / sizeMultiplier;
541
- spanHeight = (sizeToMaxHeight[delim.size] + extraViniculum + emPad)
540
+ texHeight = (sizeToMaxHeight[delim.size] + extraVinculum) / sizeMultiplier;
541
+ spanHeight = (sizeToMaxHeight[delim.size] + extraVinculum + emPad)
542
542
  / sizeMultiplier;
543
543
  span = sqrtSvg("sqrtSize" + delim.size, spanHeight, viewBoxHeight,
544
- extraViniculum, options);
544
+ extraVinculum, options);
545
545
  span.style.minWidth = "1.02em";
546
546
  advanceWidth = 1.0 / sizeMultiplier; // 1.0 from the font.
547
547
 
548
548
  } else {
549
549
  // Tall sqrt. In TeX, this would be stacked using multiple glyphs.
550
550
  // We'll use a single SVG to accomplish the same thing.
551
- spanHeight = height + extraViniculum + emPad;
552
- texHeight = height + extraViniculum;
553
- viewBoxHeight = Math.floor(1000 * height + extraViniculum) + vbPad;
554
- span = sqrtSvg("sqrtTall", spanHeight, viewBoxHeight, extraViniculum,
551
+ spanHeight = height + extraVinculum + emPad;
552
+ texHeight = height + extraVinculum;
553
+ viewBoxHeight = Math.floor(1000 * height + extraVinculum) + vbPad;
554
+ span = sqrtSvg("sqrtTall", spanHeight, viewBoxHeight, extraVinculum,
555
555
  options);
556
556
  span.style.minWidth = "0.742em";
557
557
  advanceWidth = 1.056;
@@ -567,7 +567,7 @@ const makeSqrtImage = function(
567
567
  // This actually should depend on the chosen font -- e.g. \boldmath
568
568
  // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and
569
569
  // have thicker rules.
570
- ruleWidth: (options.fontMetrics().sqrtRuleThickness + extraViniculum)
570
+ ruleWidth: (options.fontMetrics().sqrtRuleThickness + extraVinculum)
571
571
  * sizeMultiplier,
572
572
  };
573
573
  };
@@ -573,8 +573,8 @@ const mathmlBuilder: MathMLBuilder<"array"> = function(group, options) {
573
573
  // We simulate this by adding (arraystretch - 1)em to the gap. This
574
574
  // does a reasonable job of adjusting arrays containing 1 em tall content.
575
575
 
576
- // The 0.16 and 0.09 values are found emprically. They produce an array
577
- // similar to LaTeX and in which content does not interfere with \hines.
576
+ // The 0.16 and 0.09 values are found empirically. They produce an array
577
+ // similar to LaTeX and in which content does not interfere with \hlines.
578
578
  const gap = (group.arraystretch === 0.5)
579
579
  ? 0.1 // {smallmatrix}, {subarray}
580
580
  : 0.16 + group.arraystretch - 1 + (group.addJot ? 0.09 : 0);
@@ -13,9 +13,9 @@ import type {Mode} from "./types";
13
13
  // In TeX, there are actually three sets of dimensions, one for each of
14
14
  // textstyle (size index 5 and higher: >=9pt), scriptstyle (size index 3 and 4:
15
15
  // 7-8pt), and scriptscriptstyle (size index 1 and 2: 5-6pt). These are
16
- // provided in the the arrays below, in that order.
16
+ // provided in the arrays below, in that order.
17
17
  //
18
- // The font metrics are stored in fonts cmsy10, cmsy7, and cmsy5 respsectively.
18
+ // The font metrics are stored in fonts cmsy10, cmsy7, and cmsy5 respectively.
19
19
  // This was determined by running the following script:
20
20
  //
21
21
  // latex -interaction=nonstopmode \
@@ -25,7 +25,7 @@ import type {Mode} from "./types";
25
25
  // '\expandafter\show\the\scriptscriptfont2' \
26
26
  // '\stop'
27
27
  //
28
- // The metrics themselves were retreived using the following commands:
28
+ // The metrics themselves were retrieved using the following commands:
29
29
  //
30
30
  // tftopl cmsy10
31
31
  // tftopl cmsy7
@@ -230,7 +230,7 @@ export function getCharacterMetrics(
230
230
  // So if the character is in a script we support but we
231
231
  // don't have metrics for it, just use the metrics for
232
232
  // the Latin capital letter M. This is close enough because
233
- // we (currently) only care about the height of the glpyh
233
+ // we (currently) only care about the height of the glyph
234
234
  // not its width.
235
235
  if (supportedCodepoint(ch)) {
236
236
  metrics = metricMap[font][77]; // 77 is the charcode for 'M'
@@ -47,7 +47,7 @@ defineFunction({
47
47
  };
48
48
  },
49
49
  // Flow is unable to correctly infer the type of `group`, even though it's
50
- // unamibiguously determined from the passed-in `type` above.
50
+ // unambiguously determined from the passed-in `type` above.
51
51
  htmlBuilder(group: ParseNode<"xArrow">, options) {
52
52
  const style = options.style;
53
53
 
@@ -342,7 +342,7 @@ defineFunction({
342
342
  return middleDelim;
343
343
  },
344
344
  mathmlBuilder: (group, options) => {
345
- // A Firefox \middle will strech a character vertically only if it
345
+ // A Firefox \middle will stretch a character vertically only if it
346
346
  // is in the fence part of the operator dictionary at:
347
347
  // https://www.w3.org/TR/MathML3/appendixc.html.
348
348
  // So we need to avoid U+2223 and use plain "|" instead.
package/src/katex.less CHANGED
@@ -432,7 +432,7 @@
432
432
  .mtable {
433
433
  .vertical-separator {
434
434
  display: inline-block;
435
- // margin and border-right are set in Javascript
435
+ // margin and border-right are set in JavaScript
436
436
  min-width: 1px; // Prevent Chrome from omitting a line.
437
437
  }
438
438
 
package/src/mathMLTree.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * since we're mainly using MathML to improve accessibility, we don't manage
6
6
  * any of the styling state that the plain DOM nodes do.
7
7
  *
8
- * The `toNode` and `toMarkup` functions work simlarly to how they do in
8
+ * The `toNode` and `toMarkup` functions work similarly to how they do in
9
9
  * domTree.js, creating namespaced DOM nodes and HTML text markup respectively.
10
10
  */
11
11
 
@@ -166,7 +166,7 @@ export class TextNode implements MathDomNode {
166
166
 
167
167
  /**
168
168
  * Converts the text node into a string
169
- * (representing the text iteself).
169
+ * (representing the text itself).
170
170
  */
171
171
  toText(): string {
172
172
  return this.text;
package/src/parseNode.js CHANGED
@@ -72,7 +72,7 @@ type ParseNodeTypes = {
72
72
  |},
73
73
  // To avoid requiring run-time type assertions, this more carefully captures
74
74
  // the requirements on the fields per the op.js htmlBuilder logic:
75
- // - `body` and `value` are NEVER set simultanouesly.
75
+ // - `body` and `value` are NEVER set simultaneously.
76
76
  // - When `symbol` is true, `body` is set.
77
77
  "op": {|
78
78
  type: "op",