katex 0.16.18 → 0.16.19

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
@@ -18413,7 +18413,7 @@ var renderToHTMLTree = function renderToHTMLTree(expression, options) {
18413
18413
  }
18414
18414
  };
18415
18415
 
18416
- var version = "0.16.18";
18416
+ var version = "0.16.19";
18417
18417
  var __domTree = {
18418
18418
  Span,
18419
18419
  Anchor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "katex",
3
- "version": "0.16.18",
3
+ "version": "0.16.19",
4
4
  "description": "Fast math typesetting for the web.",
5
5
  "main": "dist/katex.js",
6
6
  "exports": {
package/types/katex.d.ts CHANGED
@@ -20,6 +20,43 @@ export type TrustContext =
20
20
  | { command: "\\htmlStyle", style: string }
21
21
  | { command: "\\htmlData", attributes: Record<string, string> }
22
22
 
23
+
24
+ export type Catcodes = Record<string, number>;
25
+
26
+ export interface Lexer {
27
+ input: string;
28
+ tokenRegex: RegExp;
29
+ settings: Required<KatexOptions>;
30
+ catcodes: Catcodes;
31
+ }
32
+
33
+ export interface SourceLocation {
34
+ start: number;
35
+ end: number;
36
+ lexer: Lexer;
37
+ }
38
+
39
+ export interface Token {
40
+ text: string;
41
+ loc: SourceLocation | undefined;
42
+ noexpand?: boolean;
43
+ treatAsRelax?: boolean;
44
+ }
45
+
46
+
47
+ export type StrictFunction = (
48
+ errorCode:
49
+ | "unknownSymbol"
50
+ | "unicodeTextInMathMode"
51
+ | "mathVsTextUnits"
52
+ | "commentAtEnd"
53
+ | "htmlExtension"
54
+ | "newLineInDisplayMode",
55
+ errorMsg: string,
56
+ token: Token,
57
+ ) => boolean | "error" | "warn" | "ignore" | undefined;
58
+
59
+
23
60
  /**
24
61
  * Options for `katex.render` and `katex.renderToString`.
25
62
  * @see https://katex.org/docs/options
@@ -133,7 +170,7 @@ export interface KatexOptions {
133
170
  strict?:
134
171
  | boolean
135
172
  | "ignore" | "warn" | "error"
136
- | ((errorCode: string, errorMsg: string, token: object) => boolean | "ignore" | "warn" | "error" | undefined | null);
173
+ | StrictFunction;
137
174
  /**
138
175
  * If `false` (do not trust input), prevent any commands like
139
176
  * `\includegraphics` that could enable adverse behavior, rendering them