katex 0.16.47 → 0.18.0

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.
Files changed (93) hide show
  1. package/README.md +5 -10
  2. package/cli.js +6 -9
  3. package/contrib/auto-render/index.html +1 -1
  4. package/contrib/copy-tex/README.md +3 -3
  5. package/contrib/copy-tex/index.html +1 -1
  6. package/contrib/mathtex-script-type/README.md +5 -5
  7. package/contrib/mhchem/README.md +1 -1
  8. package/contrib/render-a11y-string/render-a11y-string.ts +1 -1
  9. package/dist/README.md +5 -10
  10. package/dist/contrib/render-a11y-string.js +15 -40
  11. package/dist/contrib/render-a11y-string.min.js +1 -1
  12. package/dist/contrib/render-a11y-string.mjs +13 -33
  13. package/dist/katex-swap.css +159 -164
  14. package/dist/katex-swap.min.css +1 -1
  15. package/dist/katex.css +159 -164
  16. package/dist/katex.js +509 -849
  17. package/dist/katex.min.css +1 -1
  18. package/dist/katex.min.js +1 -1
  19. package/dist/katex.mjs +498 -831
  20. package/katex.ts +1 -1
  21. package/package.json +12 -16
  22. package/src/MacroExpander.ts +11 -8
  23. package/src/Namespace.ts +17 -21
  24. package/src/Options.ts +2 -2
  25. package/src/ParseError.ts +1 -1
  26. package/src/Parser.ts +44 -50
  27. package/src/Settings.ts +1 -1
  28. package/src/SourceLocation.ts +2 -2
  29. package/src/atoms.ts +22 -22
  30. package/src/buildCommon.ts +8 -8
  31. package/src/buildHTML.ts +12 -13
  32. package/src/buildMathML.ts +4 -4
  33. package/src/buildTree.ts +1 -1
  34. package/src/defineEnvironment.ts +1 -2
  35. package/src/defineFunction.ts +104 -112
  36. package/src/environments/array.ts +11 -15
  37. package/src/environments/cd.ts +8 -8
  38. package/src/fontMetrics.ts +2 -4
  39. package/src/functions/accent.ts +12 -15
  40. package/src/functions/accentunder.ts +4 -4
  41. package/src/functions/arrow.ts +5 -5
  42. package/src/functions/char.ts +3 -4
  43. package/src/functions/color.ts +10 -13
  44. package/src/functions/cr.ts +4 -6
  45. package/src/functions/def.ts +15 -19
  46. package/src/functions/delimsizing.ts +23 -23
  47. package/src/functions/enclose.ts +23 -34
  48. package/src/functions/environment.ts +5 -6
  49. package/src/functions/font.ts +15 -27
  50. package/src/functions/genfrac.ts +19 -23
  51. package/src/functions/hbox.ts +6 -6
  52. package/src/functions/horizBrace.ts +4 -4
  53. package/src/functions/href.ts +10 -11
  54. package/src/functions/html.ts +8 -8
  55. package/src/functions/htmlmathml.ts +5 -5
  56. package/src/functions/includegraphics.ts +7 -7
  57. package/src/functions/kern.ts +6 -6
  58. package/src/functions/lap.ts +11 -11
  59. package/src/functions/math.ts +8 -10
  60. package/src/functions/mathchoice.ts +5 -5
  61. package/src/functions/mclass.ts +16 -28
  62. package/src/functions/op.ts +16 -30
  63. package/src/functions/operatorname.ts +4 -4
  64. package/src/functions/overline.ts +4 -4
  65. package/src/functions/phantom.ts +10 -10
  66. package/src/functions/pmb.ts +5 -5
  67. package/src/functions/raisebox.ts +5 -5
  68. package/src/functions/relax.ts +4 -5
  69. package/src/functions/rule.ts +8 -8
  70. package/src/functions/sizing.ts +7 -7
  71. package/src/functions/smash.ts +6 -6
  72. package/src/functions/sqrt.ts +5 -5
  73. package/src/functions/styling.ts +5 -5
  74. package/src/functions/supsub.ts +1 -1
  75. package/src/functions/symbolsOrd.ts +3 -3
  76. package/src/functions/symbolsSpacing.ts +21 -22
  77. package/src/functions/text.ts +7 -7
  78. package/src/functions/underline.ts +5 -5
  79. package/src/functions/utils/assembleSupSub.ts +1 -1
  80. package/src/functions/vcenter.ts +5 -5
  81. package/src/functions/verb.ts +5 -5
  82. package/src/macros.ts +3 -3
  83. package/src/mathMLTree.ts +6 -10
  84. package/src/parseNode.ts +6 -480
  85. package/src/parseTree.ts +1 -6
  86. package/src/spacingData.ts +2 -1
  87. package/src/stretchy.ts +3 -3
  88. package/src/styles/katex.scss +31 -37
  89. package/src/types/index.ts +12 -0
  90. package/src/types/nodes.ts +456 -0
  91. package/src/units.ts +1 -2
  92. package/src/utils.ts +1 -1
  93. package/src/wide-character.ts +2 -2
package/README.md CHANGED
@@ -37,13 +37,13 @@ Try out KaTeX [on the demo page](https://katex.org/#demo)!
37
37
  <!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
38
38
  <html>
39
39
  <head>
40
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/katex.min.css" integrity="sha384-nH0MfJ44wi1dd7w6jinlyBgljjS8EJAh2JBoRad8a3VDw2K69vfaaqm4WnR+gXtA" crossorigin="anonymous">
40
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/katex.min.css" integrity="sha384-KfwFj/Q/jGrY4ijtfzWyW5NXzT5irvfnTq6aRnH2xPvLzLdi1XyVr7w4l2uwTq0V" crossorigin="anonymous">
41
41
 
42
42
  <!-- The loading of KaTeX is deferred to speed up page rendering -->
43
- <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/katex.min.js" integrity="sha384-CwjPRVHTvLiMBFjEoij+QZViMV5rhTOIp7CJzl24JEqpRDA1sJFHVXXLURktbYYp" crossorigin="anonymous"></script>
43
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/katex.min.js" integrity="sha384-OE4SMRr5gMJQzKSD08J46vKsKgY8NxVtO1LW+/q3NJ0WHsGsdN4oebgEjwwWuyvG" crossorigin="anonymous"></script>
44
44
 
45
45
  <!-- To automatically render math in text elements, include the auto-render extension: -->
46
- <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/contrib/auto-render.min.js" integrity="sha384-bjyGPfbij8/NDKJhSGZNP/khQVgtHUE5exjm4Ydllo42FwIgYsdLO2lXGmRBf5Mz" crossorigin="anonymous"
46
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/contrib/auto-render.min.js" integrity="sha384-bjyGPfbij8/NDKJhSGZNP/khQVgtHUE5exjm4Ydllo42FwIgYsdLO2lXGmRBf5Mz" crossorigin="anonymous"
47
47
  onload="renderMathInElement(document.body);"></script>
48
48
  </head>
49
49
  ...
@@ -109,16 +109,11 @@ Become a financial contributor and help us sustain our community.
109
109
 
110
110
  Support this project with your organization. Your logo will show up here with a link to your website.
111
111
 
112
- <a href="https://opencollective.com/katex/organization/0/website"><img src="https://opencollective.com/katex/organization/0/avatar.svg" alt="Organization 1"></a>
113
- <a href="https://opencollective.com/katex/organization/1/website"><img src="https://opencollective.com/katex/organization/1/avatar.svg" alt="Organization 2"></a>
112
+ <a href="https://opencollective.com/katex/organization/0/website"><img src="https://opencollective.com/katex/organization/0/avatar.svg?avatarHeight=112" alt="Organization 1" width="112"></a>
113
+ <a href="https://opencollective.com/katex/organization/1/website"><img src="https://opencollective.com/katex/organization/1/avatar.svg?avatarHeight=96" alt="Organization 2" width="96"></a>
114
114
  <a href="https://opencollective.com/katex/organization/2/website"><img src="https://opencollective.com/katex/organization/2/avatar.svg" alt="Organization 3"></a>
115
115
  <a href="https://opencollective.com/katex/organization/3/website"><img src="https://opencollective.com/katex/organization/3/avatar.svg" alt="Organization 4"></a>
116
116
  <a href="https://opencollective.com/katex/organization/4/website"><img src="https://opencollective.com/katex/organization/4/avatar.svg" alt="Organization 5"></a>
117
- <a href="https://opencollective.com/katex/organization/5/website"><img src="https://opencollective.com/katex/organization/5/avatar.svg" alt="Organization 6"></a>
118
- <a href="https://opencollective.com/katex/organization/6/website"><img src="https://opencollective.com/katex/organization/6/avatar.svg" alt="Organization 7"></a>
119
- <a href="https://opencollective.com/katex/organization/7/website"><img src="https://opencollective.com/katex/organization/7/avatar.svg" alt="Organization 8"></a>
120
- <a href="https://opencollective.com/katex/organization/8/website"><img src="https://opencollective.com/katex/organization/8/avatar.svg" alt="Organization 9"></a>
121
- <a href="https://opencollective.com/katex/organization/9/website"><img src="https://opencollective.com/katex/organization/9/avatar.svg" alt="Organization 10"></a>
122
117
 
123
118
  ## License
124
119
 
package/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // Simple CLI for KaTeX.
3
3
  // Reads TeX from stdin, outputs HTML to stdout.
4
4
  // To run this from the repository, you must first build KaTeX by running
5
- // `yarn` and `yarn build`.
5
+ // `pnpm install` and `pnpm build`.
6
6
 
7
7
  /* eslint no-console:0 */
8
8
 
@@ -12,7 +12,7 @@ try {
12
12
  } catch (e) {
13
13
  console.error(
14
14
  "KaTeX could not import, likely because dist/katex.js is missing.");
15
- console.error("Please run 'yarn' and 'yarn build' before running");
15
+ console.error("Please run 'pnpm install' and 'pnpm build' before running");
16
16
  console.error("cli.js from the KaTeX repository.");
17
17
  console.error();
18
18
  throw e;
@@ -23,13 +23,10 @@ const fs = require("fs");
23
23
  const {program} = require("commander");
24
24
  program.version(version);
25
25
 
26
- for (const prop in katex.SETTINGS_SCHEMA) {
27
- if (katex.SETTINGS_SCHEMA.hasOwnProperty(prop)) {
28
- const opt = katex.SETTINGS_SCHEMA[prop];
29
- if (opt.cli !== false) {
30
- program.option(opt.cli || "--" + prop, opt.cliDescription ||
31
- opt.description, opt.cliProcessor, opt.cliDefault);
32
- }
26
+ for (const [prop, opt] of Object.entries(katex.SETTINGS_SCHEMA)) {
27
+ if (opt.cli !== false) {
28
+ program.option(opt.cli || "--" + prop, opt.cliDescription ||
29
+ opt.description, opt.cliProcessor, opt.cliDefault);
33
30
  }
34
31
  }
35
32
  program.option("-f, --macro-file <path>",
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <!--To run this example from a clone of the repository, run `yarn start`
2
+ <!--To run this example from a clone of the repository, run `pnpm start`
3
3
  in the root KaTeX directory and then visit with your web browser:
4
4
  http://localhost:7936/contrib/auto-render/index.html
5
5
  -->
@@ -18,13 +18,13 @@ 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.47/dist/contrib/copy-tex.min.js" integrity="sha384-Pe2JWbaShhSRT0SESJ9XLPeAsi4yrNi7r/CiH0Coq7giBjK5a6Ae7XcybE8rNlQP" crossorigin="anonymous"></script>
21
+ <script src="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/contrib/copy-tex.min.js" integrity="sha384-Pe2JWbaShhSRT0SESJ9XLPeAsi4yrNi7r/CiH0Coq7giBjK5a6Ae7XcybE8rNlQP" 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.)
25
25
 
26
26
  See [index.html](index.html) for an example.
27
- (To run this example from a clone of the repository, run `yarn start`
27
+ (To run this example from a clone of the repository, run `pnpm start`
28
28
  in the root KaTeX directory, and then visit
29
29
  http://localhost:7936/contrib/copy-tex/index.html
30
30
  with your web browser.)
@@ -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.47/dist/contrib/copy-tex.mjs" integrity="sha384-PTy3nbMSATx5Ifo/k1ErbnbMVEp3koLGaqTD+zBo5H0fPFue/mKr1M3//74Fu6Tf" crossorigin="anonymous"></script>
38
+ <script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/contrib/copy-tex.mjs" integrity="sha384-PTy3nbMSATx5Ifo/k1ErbnbMVEp3koLGaqTD+zBo5H0fPFue/mKr1M3//74Fu6Tf" crossorigin="anonymous"></script>
39
39
  ```
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <!--To run this example from a clone of the repository, run `yarn start`
2
+ <!--To run this example from a clone of the repository, run `pnpm start`
3
3
  in the root KaTeX directory and then visit with your web browser:
4
4
  http://localhost:7936/contrib/copy-tex/index.html
5
5
  -->
@@ -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.47/dist/contrib/mathtex-script-type.min.js" integrity="sha384-W8gaN87yMtPe/iAcxlyIDA8OVOzZvVD4c/HEE6QHhIyo8yHnVSXLzzy+eNWwpivm" crossorigin="anonymous"></script>
14
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/contrib/mathtex-script-type.min.js" integrity="sha384-W8gaN87yMtPe/iAcxlyIDA8OVOzZvVD4c/HEE6QHhIyo8yHnVSXLzzy+eNWwpivm" 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.47/dist/katex.min.css" integrity="sha384-nH0MfJ44wi1dd7w6jinlyBgljjS8EJAh2JBoRad8a3VDw2K69vfaaqm4WnR+gXtA" crossorigin="anonymous">
27
- <script src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/katex.min.js" integrity="sha384-CwjPRVHTvLiMBFjEoij+QZViMV5rhTOIp7CJzl24JEqpRDA1sJFHVXXLURktbYYp" crossorigin="anonymous"></script>
28
- <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/contrib/mathtex-script-type.min.js" integrity="sha384-W8gaN87yMtPe/iAcxlyIDA8OVOzZvVD4c/HEE6QHhIyo8yHnVSXLzzy+eNWwpivm" crossorigin="anonymous"></script>
26
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/katex.min.css" integrity="sha384-KfwFj/Q/jGrY4ijtfzWyW5NXzT5irvfnTq6aRnH2xPvLzLdi1XyVr7w4l2uwTq0V" crossorigin="anonymous">
27
+ <script src="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/katex.min.js" integrity="sha384-OE4SMRr5gMJQzKSD08J46vKsKgY8NxVtO1LW+/q3NJ0WHsGsdN4oebgEjwwWuyvG" crossorigin="anonymous"></script>
28
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/contrib/mathtex-script-type.min.js" integrity="sha384-W8gaN87yMtPe/iAcxlyIDA8OVOzZvVD4c/HEE6QHhIyo8yHnVSXLzzy+eNWwpivm" 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.47/dist/contrib/mathtex-script-type.mjs" integrity="sha384-4pY6Hczg2Rj0O1719BbDGKN5JSkitfLp1BU8Jke61b3VKMgoKu1lE6al9tMzy3q2" crossorigin="anonymous"></script>
38
+ <script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/contrib/mathtex-script-type.mjs" integrity="sha384-4pY6Hczg2Rj0O1719BbDGKN5JSkitfLp1BU8Jke61b3VKMgoKu1lE6al9tMzy3q2" crossorigin="anonymous"></script>
@@ -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.47/dist/contrib/mhchem.min.js" integrity="sha384-fB8BH//9nBzROkMUsu/Dr35jWHIbnKesUo9rW0hfEgw8mZGnkAyBAjKX9F98OVuo" crossorigin="anonymous"></script>
10
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/contrib/mhchem.min.js" integrity="sha384-fB8BH//9nBzROkMUsu/Dr35jWHIbnKesUo9rW0hfEgw8mZGnkAyBAjKX9F98OVuo" 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.
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import {isAtom, type Atom} from "../../src/atoms";
18
- import type {AnyParseNode} from "../../src/parseNode";
18
+ import type {AnyParseNode} from "../../src/types/nodes";
19
19
  import type {SettingsOptions} from "../../src/Settings";
20
20
  import katex from "katex";
21
21
  const stringMap: Record<string, string> = {
package/dist/README.md CHANGED
@@ -37,13 +37,13 @@ Try out KaTeX [on the demo page](https://katex.org/#demo)!
37
37
  <!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
38
38
  <html>
39
39
  <head>
40
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/katex.min.css" integrity="sha384-nH0MfJ44wi1dd7w6jinlyBgljjS8EJAh2JBoRad8a3VDw2K69vfaaqm4WnR+gXtA" crossorigin="anonymous">
40
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/katex.min.css" integrity="sha384-KfwFj/Q/jGrY4ijtfzWyW5NXzT5irvfnTq6aRnH2xPvLzLdi1XyVr7w4l2uwTq0V" crossorigin="anonymous">
41
41
 
42
42
  <!-- The loading of KaTeX is deferred to speed up page rendering -->
43
- <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/katex.min.js" integrity="sha384-CwjPRVHTvLiMBFjEoij+QZViMV5rhTOIp7CJzl24JEqpRDA1sJFHVXXLURktbYYp" crossorigin="anonymous"></script>
43
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/katex.min.js" integrity="sha384-OE4SMRr5gMJQzKSD08J46vKsKgY8NxVtO1LW+/q3NJ0WHsGsdN4oebgEjwwWuyvG" crossorigin="anonymous"></script>
44
44
 
45
45
  <!-- To automatically render math in text elements, include the auto-render extension: -->
46
- <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/contrib/auto-render.min.js" integrity="sha384-bjyGPfbij8/NDKJhSGZNP/khQVgtHUE5exjm4Ydllo42FwIgYsdLO2lXGmRBf5Mz" crossorigin="anonymous"
46
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.18.0/dist/contrib/auto-render.min.js" integrity="sha384-bjyGPfbij8/NDKJhSGZNP/khQVgtHUE5exjm4Ydllo42FwIgYsdLO2lXGmRBf5Mz" crossorigin="anonymous"
47
47
  onload="renderMathInElement(document.body);"></script>
48
48
  </head>
49
49
  ...
@@ -109,16 +109,11 @@ Become a financial contributor and help us sustain our community.
109
109
 
110
110
  Support this project with your organization. Your logo will show up here with a link to your website.
111
111
 
112
- <a href="https://opencollective.com/katex/organization/0/website"><img src="https://opencollective.com/katex/organization/0/avatar.svg" alt="Organization 1"></a>
113
- <a href="https://opencollective.com/katex/organization/1/website"><img src="https://opencollective.com/katex/organization/1/avatar.svg" alt="Organization 2"></a>
112
+ <a href="https://opencollective.com/katex/organization/0/website"><img src="https://opencollective.com/katex/organization/0/avatar.svg?avatarHeight=112" alt="Organization 1" width="112"></a>
113
+ <a href="https://opencollective.com/katex/organization/1/website"><img src="https://opencollective.com/katex/organization/1/avatar.svg?avatarHeight=96" alt="Organization 2" width="96"></a>
114
114
  <a href="https://opencollective.com/katex/organization/2/website"><img src="https://opencollective.com/katex/organization/2/avatar.svg" alt="Organization 3"></a>
115
115
  <a href="https://opencollective.com/katex/organization/3/website"><img src="https://opencollective.com/katex/organization/3/avatar.svg" alt="Organization 4"></a>
116
116
  <a href="https://opencollective.com/katex/organization/4/website"><img src="https://opencollective.com/katex/organization/4/avatar.svg" alt="Organization 5"></a>
117
- <a href="https://opencollective.com/katex/organization/5/website"><img src="https://opencollective.com/katex/organization/5/avatar.svg" alt="Organization 6"></a>
118
- <a href="https://opencollective.com/katex/organization/6/website"><img src="https://opencollective.com/katex/organization/6/avatar.svg" alt="Organization 7"></a>
119
- <a href="https://opencollective.com/katex/organization/7/website"><img src="https://opencollective.com/katex/organization/7/avatar.svg" alt="Organization 8"></a>
120
- <a href="https://opencollective.com/katex/organization/8/website"><img src="https://opencollective.com/katex/organization/8/avatar.svg" alt="Organization 9"></a>
121
- <a href="https://opencollective.com/katex/organization/9/website"><img src="https://opencollective.com/katex/organization/9/avatar.svg" alt="Organization 10"></a>
122
117
 
123
118
  ## License
124
119
 
@@ -90,27 +90,12 @@ __webpack_require__.d(__webpack_exports__, {
90
90
  * pull in `isAtom` without dragging in the ~870-line symbol tables.
91
91
  */
92
92
 
93
- // Some of these have a "-token" suffix since these are also used as `ParseNode`
94
- // types for raw text tokens, and we want to avoid conflicts with higher-level
95
- // `ParseNode` types. These `ParseNode`s are constructed within `Parser` by
96
- // looking up the `symbols` map.
97
- const ATOMS = {
98
- "bin": 1,
99
- "close": 1,
100
- "inner": 1,
101
- "open": 1,
102
- "punct": 1,
103
- "rel": 1
104
- };
105
- const NON_ATOMS = {
106
- "accent-token": 1,
107
- "mathord": 1,
108
- "op-token": 1,
109
- "spacing": 1,
110
- "textord": 1
111
- };
93
+ const atomList = ["bin", "close", "inner", "open", "punct", "rel"];
94
+ const nonAtomList = ["accent-token", "mathord", "op-token", "spacing", "textord"];
95
+ const Atoms = new Set(atomList);
96
+ const NonAtoms = new Set(nonAtomList);
112
97
  function isAtom(value) {
113
- return value in ATOMS;
98
+ return Atoms.has(value);
114
99
  }
115
100
  // EXTERNAL MODULE: external "katex"
116
101
  var external_katex_ = __webpack_require__(757);
@@ -320,9 +305,7 @@ const handleObject = (tree, a11yStrings, atomType) => {
320
305
  }
321
306
  case "atom":
322
307
  {
323
- const {
324
- text
325
- } = tree;
308
+ const text = tree.text;
326
309
  switch (tree.family) {
327
310
  case "bin":
328
311
  {
@@ -390,10 +373,8 @@ const handleObject = (tree, a11yStrings, atomType) => {
390
373
  {
391
374
  buildRegion(a11yStrings, regionStrings => {
392
375
  // genfrac can have unbalanced delimiters
393
- const {
394
- leftDelim,
395
- rightDelim
396
- } = tree;
376
+ const leftDelim = tree.leftDelim,
377
+ rightDelim = tree.rightDelim;
397
378
 
398
379
  // NOTE: Not sure if this is a safe assumption
399
380
  // hasBarLine true -> fraction, false -> binomial
@@ -454,10 +435,8 @@ const handleObject = (tree, a11yStrings, atomType) => {
454
435
  }
455
436
  case "op":
456
437
  {
457
- const {
458
- body,
459
- name
460
- } = tree;
438
+ const body = tree.body,
439
+ name = tree.name;
461
440
  if (body) {
462
441
  buildA11yStrings(body, a11yStrings, atomType);
463
442
  } else if (name) {
@@ -524,10 +503,8 @@ const handleObject = (tree, a11yStrings, atomType) => {
524
503
  case "sqrt":
525
504
  {
526
505
  buildRegion(a11yStrings, regionStrings => {
527
- const {
528
- body,
529
- index
530
- } = tree;
506
+ const body = tree.body,
507
+ index = tree.index;
531
508
  if (index) {
532
509
  const indexString = flatten(buildA11yStrings(index, [], atomType)).join(",");
533
510
  if (indexString === "3") {
@@ -550,11 +527,9 @@ const handleObject = (tree, a11yStrings, atomType) => {
550
527
  }
551
528
  case "supsub":
552
529
  {
553
- const {
554
- base,
555
- sub,
556
- sup
557
- } = tree;
530
+ const base = tree.base,
531
+ sub = tree.sub,
532
+ sup = tree.sup;
558
533
  let isLog = false;
559
534
  if (base) {
560
535
  buildA11yStrings(base, a11yStrings, atomType);
@@ -1 +1 @@
1
- !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],r);else{var t="object"==typeof exports?r(require("katex")):r(e.katex);for(var a in t)("object"==typeof exports?exports:e)[a]=t[a]}}("undefined"!=typeof self?self:this,function(e){return function(){"use strict";var r={757:function(r){r.exports=e}},t={};function a(e){var o=t[e];if(void 0!==o)return o.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,a),n.exports}a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,{a:r}),r},a.d=function(e,r){for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)};var o={};a.d(o,{default:function(){return k}});const n={bin:1,close:1,inner:1,open:1,punct:1,rel:1};var s=a(757),l=a.n(s);const i={"(":"left parenthesis",")":"right parenthesis","[":"open bracket","]":"close bracket","\\{":"left brace","\\}":"right brace","\\lvert":"open vertical bar","\\rvert":"close vertical bar","|":"vertical bar","\\uparrow":"up arrow","\\Uparrow":"up arrow","\\downarrow":"down arrow","\\Downarrow":"down arrow","\\updownarrow":"up down arrow","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow","\\langle":"open angle","\\rangle":"close angle","\\lfloor":"open floor","\\rfloor":"close floor","\\int":"integral","\\intop":"integral","\\lim":"limit","\\ln":"natural log","\\log":"log","\\sin":"sine","\\cos":"cosine","\\tan":"tangent","\\cot":"cotangent","\\sum":"sum","/":"slash",",":"comma",".":"point","-":"negative","+":"plus","~":"tilde",":":"colon","?":"question mark","'":"apostrophe","\\%":"percent"," ":"space","\\ ":"space","\\$":"dollar sign","\\angle":"angle","\\degree":"degree","\\circ":"circle","\\vec":"vector","\\triangle":"triangle","\\pi":"pi","\\prime":"prime","\\infty":"infinity","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\omega":"omega","\\theta":"theta","\\sigma":"sigma","\\lambda":"lambda","\\tau":"tau","\\Delta":"delta","\\delta":"delta","\\mu":"mu","\\rho":"rho","\\nabla":"del","\\ell":"ell","\\ldots":"dots","\\hat":"hat","\\acute":"acute"},c={prime:"prime",degree:"degrees",circle:"degrees",2:"squared",3:"cubed"},u={"|":"open vertical bar",".":""},p={"|":"close vertical bar",".":""},d={"+":"plus","-":"minus","\\pm":"plus minus","\\cdot":"dot","*":"times","/":"divided by","\\times":"times","\\div":"divided by","\\circ":"circle","\\bullet":"bullet"},h={"=":"equals","\\approx":"approximately equals","\u2260":"does not equal","\\geq":"is greater than or equal to","\\ge":"is greater than or equal to","\\leq":"is less than or equal to","\\le":"is less than or equal to",">":"is greater than","<":"is less than","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow",":":"colon"},b={"\\underleftarrow":"left arrow","\\underrightarrow":"right arrow","\\underleftrightarrow":"left-right arrow","\\undergroup":"group","\\underlinesegment":"line segment","\\utilde":"tilde"},m=(e,r,t)=>{if(!e)return;let a;a="open"===r?e in u?u[e]:i[e]||e:"close"===r?e in p?p[e]:i[e]||e:"bin"===r?d[e]||e:"rel"===r?h[e]||e:i[e]||e;const o=t[t.length-1];/^\d+$/.test(a)&&t.length>0&&"string"==typeof o&&/^\d+$/.test(o)?t[t.length-1]+=a:a&&t.push(a)},f=(e,r)=>{const t=[];e.push(t),r(t)},w=(e,r,t)=>{switch(e.type){case"accent":f(r,r=>{g(e.base,r,t),r.push("with"),m(e.label,"normal",r),r.push("on top")});break;case"accentUnder":f(r,r=>{g(e.base,r,t),r.push("with"),m(b[e.label],"normal",r),r.push("underneath")});break;case"accent-token":case"color-token":case"kern":case"leftright-right":case"size":case"infix":case"internal":break;case"atom":{const{text:t}=e;switch(e.family){case"bin":m(t,"bin",r);break;case"close":m(t,"close",r);break;case"inner":m(e.text,"inner",r);break;case"open":m(t,"open",r);break;case"punct":m(t,"punct",r);break;case"rel":m(t,"rel",r);break;default:throw e.family,new Error('"'+e.family+'" is not a valid atom type')}break}case"color":{const a=e.color.replace(/katex-/,"");f(r,r=>{r.push("start color "+a),g(e.body,r,t),r.push("end color "+a)});break}case"delimsizing":e.delim&&"."!==e.delim&&m(e.delim,"normal",r);break;case"genfrac":f(r,r=>{const{leftDelim:a,rightDelim:o}=e;e.hasBarLine?(r.push("start fraction"),a&&m(a,"open",r),g(e.numer,r,t),r.push("divided by"),g(e.denom,r,t),o&&m(o,"close",r),r.push("end fraction")):(r.push("start binomial"),a&&m(a,"open",r),g(e.numer,r,t),r.push("over"),g(e.denom,r,t),o&&m(o,"close",r),r.push("end binomial"))});break;case"hbox":case"lap":case"ordgroup":case"raisebox":case"sizing":case"styling":case"smash":case"vcenter":case"operatorname":case"font":case"html":g(e.body,r,t);break;case"leftright":f(r,r=>{m(e.left,"open",r),g(e.body,r,t),m(e.right,"close",r)});break;case"mathord":m(e.text,"normal",r);break;case"op":{const{body:a,name:o}=e;a?g(a,r,t):o&&m(o,"normal",r);break}case"op-token":case"textord":m(e.text,t,r);break;case"overline":f(r,function(r){r.push("start overline"),g(e.body,r,t),r.push("end overline")});break;case"pmb":r.push("bold");break;case"phantom":r.push("empty space");break;case"rule":r.push("rectangle");break;case"spacing":r.push("space");break;case"sqrt":f(r,r=>{const{body:a,index:o}=e;if(o){return"3"===y(g(o,[],t)).join(",")?(r.push("cube root of"),g(a,r,t),void r.push("end cube root")):(r.push("root"),r.push("start index"),g(o,r,t),void r.push("end index"))}r.push("square root of"),g(a,r,t),r.push("end square root")});break;case"supsub":{const{base:a,sub:o,sup:n}=e;let s=!1;if(a&&(g(a,r,t),s="op"===a.type&&"\\log"===a.name),o){const e=s?"base":"subscript";f(r,function(r){r.push("start "+e),g(o,r,t),r.push("end "+e)})}n&&f(r,function(e){const r=y(g(n,[],t)).join(",");r in c?e.push(c[r]):(e.push("start superscript"),g(n,e,t),e.push("end superscript"))});break}case"text":if("\\textbf"===e.font){f(r,function(r){r.push("start bold text"),g(e.body,r,t),r.push("end bold text")});break}f(r,function(r){r.push("start text"),g(e.body,r,t),r.push("end text")});break;case"enclose":if(/cancel/.test(e.label)){f(r,function(r){r.push("start cancel"),g(e.body,r,t),r.push("end cancel")});break}if(/box/.test(e.label)){f(r,function(r){r.push("start box"),g(e.body,r,t),r.push("end box")});break}if(/sout/.test(e.label)){f(r,function(r){r.push("start strikeout"),g(e.body,r,t),r.push("end strikeout")});break}if(/phase/.test(e.label)){f(r,function(r){r.push("start phase angle"),g(e.body,r,t),r.push("end phase angle")});break}throw new Error("KaTeX-a11y: enclose node with "+e.label+" not supported yet");case"vphantom":throw new Error("KaTeX-a11y: vphantom not implemented yet");case"array":throw new Error("KaTeX-a11y: array not implemented yet");case"raw":throw new Error("KaTeX-a11y: raw not implemented yet");case"url":throw new Error("KaTeX-a11y: url not implemented yet");case"tag":throw new Error("KaTeX-a11y: tag not implemented yet");case"verb":m("start verbatim","normal",r),m(e.body,"normal",r),m("end verbatim","normal",r);break;case"environment":throw new Error("KaTeX-a11y: environment not implemented yet");case"horizBrace":m("start "+e.label.slice(1),"normal",r),g(e.base,r,t),m("end "+e.label.slice(1),"normal",r);break;case"includegraphics":throw new Error("KaTeX-a11y: includegraphics not implemented yet");case"href":throw new Error("KaTeX-a11y: href not implemented yet");case"cr":throw new Error("KaTeX-a11y: cr not implemented yet");case"underline":f(r,function(r){r.push("start underline"),g(e.body,r,t),r.push("end underline")});break;case"xArrow":throw new Error("KaTeX-a11y: xArrow not implemented yet");case"cdlabel":throw new Error("KaTeX-a11y: cdlabel not implemented yet");case"cdlabelparent":throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");case"mclass":{const t=e.mclass.slice(1);if("normal"!==t&&!(t in n))throw new Error('Unexpected mclass atom type: "'+t+'"');g(e.body,r,t);break}case"mathchoice":g(e.text,r,t);break;case"htmlmathml":g(e.mathml,r,t);break;case"middle":m(e.delim,t,r);break;default:throw new Error("KaTeX a11y un-recognized type: "+e.type)}},g=function(e,r,t){if(void 0===r&&(r=[]),e instanceof Array)for(let a=0;a<e.length;a++)g(e[a],r,t);else w(e,r,t);return r},y=function(e){let r=[];return e.forEach(function(e){Array.isArray(e)?r=r.concat(y(e)):r.push(e)}),r};var k=function(e,r){const t=l().__parse(e,r),a=g(t,[],"normal");return y(a).join(", ")};return o=o.default}()});
1
+ !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],r);else{var t="object"==typeof exports?r(require("katex")):r(e.katex);for(var a in t)("object"==typeof exports?exports:e)[a]=t[a]}}("undefined"!=typeof self?self:this,function(e){return function(){"use strict";var r={757:function(r){r.exports=e}},t={};function a(e){var o=t[e];if(void 0!==o)return o.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,a),n.exports}a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,{a:r}),r},a.d=function(e,r){for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)};var o={};a.d(o,{default:function(){return k}});const n=new Set(["bin","close","inner","open","punct","rel"]);new Set(["accent-token","mathord","op-token","spacing","textord"]);var s=a(757),l=a.n(s);const i={"(":"left parenthesis",")":"right parenthesis","[":"open bracket","]":"close bracket","\\{":"left brace","\\}":"right brace","\\lvert":"open vertical bar","\\rvert":"close vertical bar","|":"vertical bar","\\uparrow":"up arrow","\\Uparrow":"up arrow","\\downarrow":"down arrow","\\Downarrow":"down arrow","\\updownarrow":"up down arrow","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow","\\langle":"open angle","\\rangle":"close angle","\\lfloor":"open floor","\\rfloor":"close floor","\\int":"integral","\\intop":"integral","\\lim":"limit","\\ln":"natural log","\\log":"log","\\sin":"sine","\\cos":"cosine","\\tan":"tangent","\\cot":"cotangent","\\sum":"sum","/":"slash",",":"comma",".":"point","-":"negative","+":"plus","~":"tilde",":":"colon","?":"question mark","'":"apostrophe","\\%":"percent"," ":"space","\\ ":"space","\\$":"dollar sign","\\angle":"angle","\\degree":"degree","\\circ":"circle","\\vec":"vector","\\triangle":"triangle","\\pi":"pi","\\prime":"prime","\\infty":"infinity","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\omega":"omega","\\theta":"theta","\\sigma":"sigma","\\lambda":"lambda","\\tau":"tau","\\Delta":"delta","\\delta":"delta","\\mu":"mu","\\rho":"rho","\\nabla":"del","\\ell":"ell","\\ldots":"dots","\\hat":"hat","\\acute":"acute"},c={prime:"prime",degree:"degrees",circle:"degrees",2:"squared",3:"cubed"},p={"|":"open vertical bar",".":""},u={"|":"close vertical bar",".":""},d={"+":"plus","-":"minus","\\pm":"plus minus","\\cdot":"dot","*":"times","/":"divided by","\\times":"times","\\div":"divided by","\\circ":"circle","\\bullet":"bullet"},h={"=":"equals","\\approx":"approximately equals","\u2260":"does not equal","\\geq":"is greater than or equal to","\\ge":"is greater than or equal to","\\leq":"is less than or equal to","\\le":"is less than or equal to",">":"is greater than","<":"is less than","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow",":":"colon"},b={"\\underleftarrow":"left arrow","\\underrightarrow":"right arrow","\\underleftrightarrow":"left-right arrow","\\undergroup":"group","\\underlinesegment":"line segment","\\utilde":"tilde"},m=(e,r,t)=>{if(!e)return;let a;a="open"===r?e in p?p[e]:i[e]||e:"close"===r?e in u?u[e]:i[e]||e:"bin"===r?d[e]||e:"rel"===r?h[e]||e:i[e]||e;const o=t[t.length-1];/^\d+$/.test(a)&&t.length>0&&"string"==typeof o&&/^\d+$/.test(o)?t[t.length-1]+=a:a&&t.push(a)},f=(e,r)=>{const t=[];e.push(t),r(t)},w=(e,r,t)=>{switch(e.type){case"accent":f(r,r=>{g(e.base,r,t),r.push("with"),m(e.label,"normal",r),r.push("on top")});break;case"accentUnder":f(r,r=>{g(e.base,r,t),r.push("with"),m(b[e.label],"normal",r),r.push("underneath")});break;case"accent-token":case"color-token":case"kern":case"leftright-right":case"size":case"infix":case"internal":break;case"atom":{const t=e.text;switch(e.family){case"bin":m(t,"bin",r);break;case"close":m(t,"close",r);break;case"inner":m(e.text,"inner",r);break;case"open":m(t,"open",r);break;case"punct":m(t,"punct",r);break;case"rel":m(t,"rel",r);break;default:throw e.family,new Error('"'+e.family+'" is not a valid atom type')}break}case"color":{const a=e.color.replace(/katex-/,"");f(r,r=>{r.push("start color "+a),g(e.body,r,t),r.push("end color "+a)});break}case"delimsizing":e.delim&&"."!==e.delim&&m(e.delim,"normal",r);break;case"genfrac":f(r,r=>{const a=e.leftDelim,o=e.rightDelim;e.hasBarLine?(r.push("start fraction"),a&&m(a,"open",r),g(e.numer,r,t),r.push("divided by"),g(e.denom,r,t),o&&m(o,"close",r),r.push("end fraction")):(r.push("start binomial"),a&&m(a,"open",r),g(e.numer,r,t),r.push("over"),g(e.denom,r,t),o&&m(o,"close",r),r.push("end binomial"))});break;case"hbox":case"lap":case"ordgroup":case"raisebox":case"sizing":case"styling":case"smash":case"vcenter":case"operatorname":case"font":case"html":g(e.body,r,t);break;case"leftright":f(r,r=>{m(e.left,"open",r),g(e.body,r,t),m(e.right,"close",r)});break;case"mathord":m(e.text,"normal",r);break;case"op":{const a=e.body,o=e.name;a?g(a,r,t):o&&m(o,"normal",r);break}case"op-token":case"textord":m(e.text,t,r);break;case"overline":f(r,function(r){r.push("start overline"),g(e.body,r,t),r.push("end overline")});break;case"pmb":r.push("bold");break;case"phantom":r.push("empty space");break;case"rule":r.push("rectangle");break;case"spacing":r.push("space");break;case"sqrt":f(r,r=>{const a=e.body,o=e.index;if(o){return"3"===y(g(o,[],t)).join(",")?(r.push("cube root of"),g(a,r,t),void r.push("end cube root")):(r.push("root"),r.push("start index"),g(o,r,t),void r.push("end index"))}r.push("square root of"),g(a,r,t),r.push("end square root")});break;case"supsub":{const a=e.base,o=e.sub,n=e.sup;let s=!1;if(a&&(g(a,r,t),s="op"===a.type&&"\\log"===a.name),o){const e=s?"base":"subscript";f(r,function(r){r.push("start "+e),g(o,r,t),r.push("end "+e)})}n&&f(r,function(e){const r=y(g(n,[],t)).join(",");r in c?e.push(c[r]):(e.push("start superscript"),g(n,e,t),e.push("end superscript"))});break}case"text":if("\\textbf"===e.font){f(r,function(r){r.push("start bold text"),g(e.body,r,t),r.push("end bold text")});break}f(r,function(r){r.push("start text"),g(e.body,r,t),r.push("end text")});break;case"enclose":if(/cancel/.test(e.label)){f(r,function(r){r.push("start cancel"),g(e.body,r,t),r.push("end cancel")});break}if(/box/.test(e.label)){f(r,function(r){r.push("start box"),g(e.body,r,t),r.push("end box")});break}if(/sout/.test(e.label)){f(r,function(r){r.push("start strikeout"),g(e.body,r,t),r.push("end strikeout")});break}if(/phase/.test(e.label)){f(r,function(r){r.push("start phase angle"),g(e.body,r,t),r.push("end phase angle")});break}throw new Error("KaTeX-a11y: enclose node with "+e.label+" not supported yet");case"vphantom":throw new Error("KaTeX-a11y: vphantom not implemented yet");case"array":throw new Error("KaTeX-a11y: array not implemented yet");case"raw":throw new Error("KaTeX-a11y: raw not implemented yet");case"url":throw new Error("KaTeX-a11y: url not implemented yet");case"tag":throw new Error("KaTeX-a11y: tag not implemented yet");case"verb":m("start verbatim","normal",r),m(e.body,"normal",r),m("end verbatim","normal",r);break;case"environment":throw new Error("KaTeX-a11y: environment not implemented yet");case"horizBrace":m("start "+e.label.slice(1),"normal",r),g(e.base,r,t),m("end "+e.label.slice(1),"normal",r);break;case"includegraphics":throw new Error("KaTeX-a11y: includegraphics not implemented yet");case"href":throw new Error("KaTeX-a11y: href not implemented yet");case"cr":throw new Error("KaTeX-a11y: cr not implemented yet");case"underline":f(r,function(r){r.push("start underline"),g(e.body,r,t),r.push("end underline")});break;case"xArrow":throw new Error("KaTeX-a11y: xArrow not implemented yet");case"cdlabel":throw new Error("KaTeX-a11y: cdlabel not implemented yet");case"cdlabelparent":throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");case"mclass":{const t=e.mclass.slice(1);if("normal"!==t&&(a=t,!n.has(a)))throw new Error('Unexpected mclass atom type: "'+t+'"');g(e.body,r,t);break}case"mathchoice":g(e.text,r,t);break;case"htmlmathml":g(e.mathml,r,t);break;case"middle":m(e.delim,t,r);break;default:throw new Error("KaTeX a11y un-recognized type: "+e.type)}var a},g=function(e,r,t){if(void 0===r&&(r=[]),e instanceof Array)for(let a=0;a<e.length;a++)g(e[a],r,t);else w(e,r,t);return r},y=function(e){let r=[];return e.forEach(function(e){Array.isArray(e)?r=r.concat(y(e)):r.push(e)}),r};var k=function(e,r){const t=l().__parse(e,r),a=g(t,[],"normal");return y(a).join(", ")};return o=o.default}()});
@@ -5,20 +5,10 @@ import katex from '../katex.mjs';
5
5
  * `symbols.ts` so that consumers (notably `contrib/render-a11y-string`) can
6
6
  * pull in `isAtom` without dragging in the ~870-line symbol tables.
7
7
  */
8
- // Some of these have a "-token" suffix since these are also used as `ParseNode`
9
- // types for raw text tokens, and we want to avoid conflicts with higher-level
10
- // `ParseNode` types. These `ParseNode`s are constructed within `Parser` by
11
- // looking up the `symbols` map.
12
- var ATOMS = {
13
- "bin": 1,
14
- "close": 1,
15
- "inner": 1,
16
- "open": 1,
17
- "punct": 1,
18
- "rel": 1
19
- };
8
+ var atomList = ["bin", "close", "inner", "open", "punct", "rel"];
9
+ var Atoms = new Set(atomList);
20
10
  function isAtom(value) {
21
- return value in ATOMS;
11
+ return Atoms.has(value);
22
12
  }
23
13
 
24
14
  /**
@@ -221,9 +211,7 @@ var handleObject = (tree, a11yStrings, atomType) => {
221
211
  }
222
212
  case "atom":
223
213
  {
224
- var {
225
- text
226
- } = tree;
214
+ var text = tree.text;
227
215
  switch (tree.family) {
228
216
  case "bin":
229
217
  {
@@ -291,10 +279,8 @@ var handleObject = (tree, a11yStrings, atomType) => {
291
279
  {
292
280
  buildRegion(a11yStrings, regionStrings => {
293
281
  // genfrac can have unbalanced delimiters
294
- var {
295
- leftDelim,
296
- rightDelim
297
- } = tree;
282
+ var leftDelim = tree.leftDelim,
283
+ rightDelim = tree.rightDelim;
298
284
  // NOTE: Not sure if this is a safe assumption
299
285
  // hasBarLine true -> fraction, false -> binomial
300
286
  if (tree.hasBarLine) {
@@ -354,10 +340,8 @@ var handleObject = (tree, a11yStrings, atomType) => {
354
340
  }
355
341
  case "op":
356
342
  {
357
- var {
358
- body,
359
- name
360
- } = tree;
343
+ var body = tree.body,
344
+ name = tree.name;
361
345
  if (body) {
362
346
  _buildA11yStrings(body, a11yStrings, atomType);
363
347
  } else if (name) {
@@ -424,10 +408,8 @@ var handleObject = (tree, a11yStrings, atomType) => {
424
408
  case "sqrt":
425
409
  {
426
410
  buildRegion(a11yStrings, regionStrings => {
427
- var {
428
- body,
429
- index
430
- } = tree;
411
+ var body = tree.body,
412
+ index = tree.index;
431
413
  if (index) {
432
414
  var indexString = _flatten(_buildA11yStrings(index, [], atomType)).join(",");
433
415
  if (indexString === "3") {
@@ -450,11 +432,9 @@ var handleObject = (tree, a11yStrings, atomType) => {
450
432
  }
451
433
  case "supsub":
452
434
  {
453
- var {
454
- base,
455
- sub,
456
- sup
457
- } = tree;
435
+ var base = tree.base,
436
+ sub = tree.sub,
437
+ sup = tree.sup;
458
438
  var isLog = false;
459
439
  if (base) {
460
440
  _buildA11yStrings(base, a11yStrings, atomType);