katex 0.16.32 → 0.16.34
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/README.md +3 -3
- package/contrib/auto-render/{auto-render.js → auto-render.ts} +41 -19
- package/contrib/auto-render/{splitAtDelimiters.js → splitAtDelimiters.ts} +18 -4
- package/contrib/auto-render/test/{auto-render-spec.js → auto-render-spec.ts} +10 -2
- package/contrib/copy-tex/README.md +2 -2
- package/contrib/copy-tex/{copy-tex.js → copy-tex.ts} +4 -6
- package/contrib/copy-tex/{katex2tex.js → katex2tex.ts} +2 -3
- package/contrib/mathtex-script-type/README.md +5 -5
- package/contrib/mhchem/README.md +1 -1
- package/contrib/render-a11y-string/{render-a11y-string.js → render-a11y-string.ts} +18 -33
- package/contrib/render-a11y-string/test/{render-a11y-string-spec.js → render-a11y-string-spec.ts} +0 -1
- package/dist/README.md +3 -3
- package/dist/contrib/auto-render.js +24 -57
- package/dist/contrib/auto-render.min.js +1 -1
- package/dist/contrib/auto-render.mjs +16586 -210
- package/dist/contrib/copy-tex.js +23 -37
- package/dist/contrib/copy-tex.min.js +1 -1
- package/dist/contrib/copy-tex.mjs +77 -95
- package/dist/contrib/mathtex-script-type.js +0 -3
- package/dist/contrib/mathtex-script-type.mjs +16427 -4
- package/dist/contrib/mhchem.js +55 -303
- package/dist/contrib/mhchem.mjs +12884 -723
- package/dist/contrib/render-a11y-string.js +13 -108
- package/dist/contrib/render-a11y-string.min.js +1 -1
- package/dist/contrib/render-a11y-string.mjs +17020 -760
- package/dist/katex-swap.css +2 -1
- package/dist/katex-swap.min.css +1 -1
- package/dist/katex.css +2 -1
- package/dist/katex.js +4547 -5680
- package/dist/katex.min.css +1 -1
- package/dist/katex.min.js +1 -1
- package/dist/katex.mjs +11854 -13828
- package/{katex.js → katex.ts} +8 -5
- package/package.json +34 -31
- package/src/{Lexer.js → Lexer.ts} +1 -2
- package/src/{MacroExpander.js → MacroExpander.ts} +11 -15
- package/src/{Namespace.js → Namespace.ts} +4 -6
- package/src/{Options.js → Options.ts} +7 -12
- package/src/{ParseError.js → ParseError.ts} +16 -26
- package/src/{Parser.js → Parser.ts} +68 -56
- package/src/{Settings.js → Settings.ts} +70 -70
- package/src/{SourceLocation.js → SourceLocation.ts} +6 -7
- package/src/{Style.js → Style.ts} +4 -5
- package/src/{Token.js → Token.ts} +8 -6
- package/src/{buildCommon.js → buildCommon.ts} +62 -55
- package/src/{buildHTML.js → buildHTML.ts} +29 -25
- package/src/{buildMathML.js → buildMathML.ts} +15 -13
- package/src/{buildTree.js → buildTree.ts} +1 -2
- package/src/{defineEnvironment.js → defineEnvironment.ts} +26 -27
- package/src/{defineFunction.js → defineFunction.ts} +54 -56
- package/src/{defineMacro.js → defineMacro.ts} +12 -13
- package/src/{delimiter.js → delimiter.ts} +19 -17
- package/src/{domTree.js → domTree.ts} +94 -103
- package/src/environments/{array.js → array.ts} +109 -99
- package/src/environments/{cd.js → cd.ts} +9 -11
- package/src/{environments.js → environments.ts} +0 -1
- package/src/{fontMetrics.js → fontMetrics.ts} +10 -12
- package/src/fontMetricsData.d.ts +3 -0
- package/src/functions/{accent.js → accent.ts} +1 -2
- package/src/functions/{accentunder.js → accentunder.ts} +0 -1
- package/src/functions/{arrow.js → arrow.ts} +4 -6
- package/src/functions/{char.js → char.ts} +0 -1
- package/src/functions/{color.js → color.ts} +5 -6
- package/src/functions/{cr.js → cr.ts} +0 -1
- package/src/functions/{def.js → def.ts} +9 -7
- package/src/functions/{delimsizing.js → delimsizing.ts} +11 -9
- package/src/functions/{enclose.js → enclose.ts} +3 -4
- package/src/functions/{environment.js → environment.ts} +2 -3
- package/src/functions/{font.js → font.ts} +4 -4
- package/src/functions/{genfrac.js → genfrac.ts} +14 -15
- package/src/functions/{hbox.js → hbox.ts} +0 -1
- package/src/functions/{horizBrace.js → horizBrace.ts} +4 -5
- package/src/functions/{href.js → href.ts} +4 -4
- package/src/functions/{html.js → html.ts} +3 -3
- package/src/functions/{htmlmathml.js → htmlmathml.ts} +0 -1
- package/src/functions/{includegraphics.js → includegraphics.ts} +0 -1
- package/src/functions/{kern.js → kern.ts} +0 -1
- package/src/functions/{lap.js → lap.ts} +0 -1
- package/src/functions/{math.js → math.ts} +0 -1
- package/src/functions/{mathchoice.js → mathchoice.ts} +2 -2
- package/src/functions/{mclass.js → mclass.ts} +5 -6
- package/src/functions/{op.js → op.ts} +9 -11
- package/src/functions/{operatorname.js → operatorname.ts} +4 -7
- package/src/functions/{ordgroup.js → ordgroup.ts} +0 -2
- package/src/functions/{overline.js → overline.ts} +0 -1
- package/src/functions/{phantom.js → phantom.ts} +0 -1
- package/src/functions/{pmb.js → pmb.ts} +0 -1
- package/src/functions/{raisebox.js → raisebox.ts} +0 -1
- package/src/functions/{relax.js → relax.ts} +0 -1
- package/src/functions/{rule.js → rule.ts} +0 -1
- package/src/functions/{sizing.js → sizing.ts} +0 -1
- package/src/functions/{smash.js → smash.ts} +2 -4
- package/src/functions/{sqrt.js → sqrt.ts} +0 -1
- package/src/functions/{styling.js → styling.ts} +3 -3
- package/src/functions/{supsub.js → supsub.ts} +6 -8
- package/src/functions/{symbolsOp.js → symbolsOp.ts} +0 -2
- package/src/functions/{symbolsOrd.js → symbolsOrd.ts} +1 -2
- package/src/functions/{symbolsSpacing.js → symbolsSpacing.ts} +2 -3
- package/src/functions/{tag.js → tag.ts} +0 -2
- package/src/functions/{text.js → text.ts} +7 -6
- package/src/functions/{underline.js → underline.ts} +0 -1
- package/src/functions/utils/{assembleSupSub.js → assembleSupSub.ts} +2 -3
- package/src/functions/{vcenter.js → vcenter.ts} +0 -2
- package/src/functions/{verb.js → verb.ts} +0 -1
- package/src/{functions.js → functions.ts} +0 -1
- package/src/{macros.js → macros.ts} +10 -8
- package/src/{mathMLTree.js → mathMLTree.ts} +5 -6
- package/src/parseNode.ts +522 -0
- package/src/{parseTree.js → parseTree.ts} +5 -3
- package/src/{spacingData.js → spacingData.ts} +11 -12
- package/src/{stretchy.js → stretchy.ts} +7 -7
- package/src/styles/katex-swap.scss +1 -4
- package/src/styles/katex.scss +9 -0
- package/src/{svgGeometry.js → svgGeometry.ts} +1 -2
- package/src/{symbols.js → symbols.ts} +6 -6
- package/src/{tree.js → tree.ts} +5 -7
- package/src/{types.js → types.ts} +1 -2
- package/src/unicodeAccents.js +4 -1
- package/src/{unicodeScripts.js → unicodeScripts.ts} +1 -3
- package/src/{unicodeSupOrSub.js → unicodeSupOrSub.ts} +1 -1
- package/src/unicodeSymbols.js +4 -3
- package/src/{units.js → units.ts} +2 -4
- package/src/{utils.js → utils.ts} +2 -3
- package/src/{wide-character.js → wide-character.ts} +8 -10
- package/types/katex.d.ts +13 -12
- package/src/parseNode.js +0 -523
package/src/{tree.js → tree.ts}
RENAMED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
1
|
import type {CssStyle, HtmlDomNode} from "./domTree";
|
|
4
2
|
import type {MathDomNode} from "./mathMLTree";
|
|
5
3
|
|
|
@@ -16,16 +14,16 @@ export interface VirtualNode {
|
|
|
16
14
|
* placed into the DOM doesn't have any representation itself. It only contains
|
|
17
15
|
* children and doesn't have any DOM node properties.
|
|
18
16
|
*/
|
|
19
|
-
export class DocumentFragment<ChildType
|
|
17
|
+
export class DocumentFragment<ChildType extends VirtualNode>
|
|
20
18
|
implements HtmlDomNode, MathDomNode {
|
|
21
|
-
children:
|
|
19
|
+
children: ReadonlyArray<ChildType>;
|
|
22
20
|
classes: string[];
|
|
23
21
|
height: number;
|
|
24
22
|
depth: number;
|
|
25
23
|
maxFontSize: number;
|
|
26
24
|
style: CssStyle; // Never used; needed for satisfying interface.
|
|
27
25
|
|
|
28
|
-
constructor(children:
|
|
26
|
+
constructor(children: ReadonlyArray<ChildType>) {
|
|
29
27
|
this.children = children;
|
|
30
28
|
this.classes = [];
|
|
31
29
|
this.height = 0;
|
|
@@ -68,8 +66,8 @@ export class DocumentFragment<ChildType: VirtualNode>
|
|
|
68
66
|
toText(): string {
|
|
69
67
|
// To avoid this, we would subclass documentFragment separately for
|
|
70
68
|
// MathML, but polyfills for subclassing is expensive per PR 1469.
|
|
71
|
-
//
|
|
72
|
-
const toText = (child: ChildType): string => child.toText();
|
|
69
|
+
// TODO(ts): Only works for ChildType = MathDomNode.
|
|
70
|
+
const toText = (child: ChildType): string => (child as unknown as MathDomNode).toText();
|
|
73
71
|
return this.children.map(toText).join("");
|
|
74
72
|
}
|
|
75
73
|
}
|
package/src/unicodeAccents.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// math mode (when they exist).
|
|
3
3
|
// This exports a CommonJS module, allowing to be required in unicodeSymbols
|
|
4
4
|
// without transpiling.
|
|
5
|
-
|
|
5
|
+
/** @type {Record<string, {text: string, math?: string}>} */
|
|
6
|
+
const unicodeAccents = {
|
|
6
7
|
'\u0301': {text: "\\'", math: '\\acute'},
|
|
7
8
|
'\u0300': {text: '\\`', math: '\\grave'},
|
|
8
9
|
'\u0308': {text: '\\"', math: '\\ddot'},
|
|
@@ -16,3 +17,5 @@ module.exports = {
|
|
|
16
17
|
'\u030b': {text: '\\H'},
|
|
17
18
|
'\u0327': {text: '\\c'},
|
|
18
19
|
};
|
|
20
|
+
|
|
21
|
+
module.exports = unicodeAccents;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
1
|
/*
|
|
4
2
|
* This file defines the Unicode scripts and script families that we
|
|
5
3
|
* support. To add new scripts or families, just add a new entry to the
|
|
@@ -88,7 +86,7 @@ const scriptData: Array<Script> = [
|
|
|
88
86
|
* Given a codepoint, return the name of the script or script family
|
|
89
87
|
* it is from, or null if it is not part of a known block
|
|
90
88
|
*/
|
|
91
|
-
export function scriptFromCodepoint(codepoint: number):
|
|
89
|
+
export function scriptFromCodepoint(codepoint: number): string | null | undefined {
|
|
92
90
|
for (let i = 0; i < scriptData.length; i++) {
|
|
93
91
|
const script = scriptData[i];
|
|
94
92
|
for (let i = 0; i < script.blocks.length; i++) {
|
package/src/unicodeSymbols.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
// @
|
|
1
|
+
// @ts-check
|
|
2
2
|
// This is an internal module, not part of the KaTeX distribution,
|
|
3
3
|
// whose purpose is to generate `unicodeSymbols` in Parser.js
|
|
4
4
|
// In this way, only this module, and not the distribution/browser,
|
|
5
5
|
// needs String's normalize function. As this file is not transpiled,
|
|
6
|
-
//
|
|
6
|
+
// JSDoc type syntax is used.
|
|
7
7
|
const accents = require('./unicodeAccents');
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
/** @type {Record<string, string>} */
|
|
10
|
+
const result = {};
|
|
10
11
|
const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" +
|
|
11
12
|
"αβγδεϵζηθϑικλμνξοπϖρϱςστυφϕχψωΓΔΘΛΞΠΣΥΦΨΩ";
|
|
12
13
|
for (const letter of letters) {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* This file does conversion between units. In particular, it provides
|
|
5
3
|
* calculateSize to convert other units into ems.
|
|
@@ -12,7 +10,7 @@ import Options from "./Options";
|
|
|
12
10
|
// Thus, multiplying a length by this number converts the length from units
|
|
13
11
|
// into pts. Dividing the result by ptPerEm gives the number of ems
|
|
14
12
|
// *assuming* a font size of ptPerEm (normal size, normal style).
|
|
15
|
-
const ptPerUnit = {
|
|
13
|
+
const ptPerUnit: Record<string, number> = {
|
|
16
14
|
// https://en.wikibooks.org/wiki/LaTeX/Lengths and
|
|
17
15
|
// https://tex.stackexchange.com/a/8263
|
|
18
16
|
"pt": 1, // TeX point
|
|
@@ -37,7 +35,7 @@ const relativeUnit = {
|
|
|
37
35
|
"mu": true,
|
|
38
36
|
};
|
|
39
37
|
|
|
40
|
-
export type Measurement = {
|
|
38
|
+
export type Measurement = { number: number, unit: string };
|
|
41
39
|
|
|
42
40
|
/**
|
|
43
41
|
* Determine whether the specified unit (either a string defining the unit
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @flow
|
|
2
1
|
/**
|
|
3
2
|
* This file contains a list of utility functions which are useful in other
|
|
4
3
|
* files.
|
|
@@ -11,7 +10,7 @@ const uppercase = /([A-Z])/g;
|
|
|
11
10
|
export const hyphenate = (str: string): string =>
|
|
12
11
|
str.replace(uppercase, "-$1").toLowerCase();
|
|
13
12
|
|
|
14
|
-
const ESCAPE_LOOKUP = {
|
|
13
|
+
const ESCAPE_LOOKUP: Record<string, string> = {
|
|
15
14
|
"&": "&",
|
|
16
15
|
">": ">",
|
|
17
16
|
"<": "<",
|
|
@@ -24,7 +23,7 @@ const ESCAPE_REGEX = /[&><"']/g;
|
|
|
24
23
|
/**
|
|
25
24
|
* Escapes text to prevent scripting attacks.
|
|
26
25
|
*/
|
|
27
|
-
export const escape = (text:
|
|
26
|
+
export const escape = (text: unknown): string =>
|
|
28
27
|
String(text).replace(ESCAPE_REGEX, match => ESCAPE_LOOKUP[match]);
|
|
29
28
|
|
|
30
29
|
/**
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* This file provides support for Unicode range U+1D400 to U+1D7FF,
|
|
5
3
|
* Mathematical Alphanumeric Symbols.
|
|
@@ -21,7 +19,7 @@ import ParseError from "./ParseError";
|
|
|
21
19
|
* * The font name, so that KaTeX can get font metrics.
|
|
22
20
|
*/
|
|
23
21
|
|
|
24
|
-
const wideLatinLetterData
|
|
22
|
+
const wideLatinLetterData = [
|
|
25
23
|
["mathbf", "textbf", "Main-Bold"], // A-Z bold upright
|
|
26
24
|
["mathbf", "textbf", "Main-Bold"], // a-z bold upright
|
|
27
25
|
|
|
@@ -63,20 +61,20 @@ const wideLatinLetterData: Array<[string, string, string]> = [
|
|
|
63
61
|
|
|
64
62
|
["mathtt", "texttt", "Typewriter-Regular"], // A-Z monospace
|
|
65
63
|
["mathtt", "texttt", "Typewriter-Regular"], // a-z monospace
|
|
66
|
-
];
|
|
64
|
+
] as const satisfies readonly (readonly [string, string, string])[];
|
|
67
65
|
|
|
68
|
-
const wideNumeralData
|
|
66
|
+
const wideNumeralData = [
|
|
69
67
|
["mathbf", "textbf", "Main-Bold"], // 0-9 bold
|
|
70
68
|
["", "", ""], // 0-9 double-struck. No KaTeX font.
|
|
71
69
|
["mathsf", "textsf", "SansSerif-Regular"], // 0-9 sans-serif
|
|
72
70
|
["mathboldsf", "textboldsf", "SansSerif-Bold"], // 0-9 bold sans-serif
|
|
73
71
|
["mathtt", "texttt", "Typewriter-Regular"], // 0-9 monospace
|
|
74
|
-
];
|
|
72
|
+
] as const satisfies readonly (readonly [string, string, string])[];
|
|
75
73
|
|
|
76
|
-
export const wideCharacterFont =
|
|
74
|
+
export const wideCharacterFont = (
|
|
77
75
|
wideChar: string,
|
|
78
76
|
mode: Mode,
|
|
79
|
-
): [string, string] {
|
|
77
|
+
): [string, string] => {
|
|
80
78
|
|
|
81
79
|
// IE doesn't support codePointAt(). So work with the surrogate pair.
|
|
82
80
|
const H = wideChar.charCodeAt(0); // high surrogate
|
|
@@ -89,12 +87,12 @@ export const wideCharacterFont = function(
|
|
|
89
87
|
// wideLatinLetterData contains exactly 26 chars on each row.
|
|
90
88
|
// So we can calculate the relevant row. No traverse necessary.
|
|
91
89
|
const i = Math.floor((codePoint - 0x1D400) / 26);
|
|
92
|
-
return [wideLatinLetterData[i][2], wideLatinLetterData[i][j]];
|
|
90
|
+
return [wideLatinLetterData[i]![2], wideLatinLetterData[i]![j]];
|
|
93
91
|
|
|
94
92
|
} else if (0x1D7CE <= codePoint && codePoint <= 0x1D7FF) {
|
|
95
93
|
// Numerals, ten per row.
|
|
96
94
|
const i = Math.floor((codePoint - 0x1D7CE) / 10);
|
|
97
|
-
return [wideNumeralData[i][2], wideNumeralData[i][j]];
|
|
95
|
+
return [wideNumeralData[i]![2], wideNumeralData[i]![j]];
|
|
98
96
|
|
|
99
97
|
} else if (codePoint === 0x1D6A5 || codePoint === 0x1D6A6) {
|
|
100
98
|
// dotless i or j
|
package/types/katex.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ export interface KatexOptions {
|
|
|
66
66
|
* If `true` the math will be rendered in display mode.
|
|
67
67
|
* If `false` the math will be rendered in inline mode.
|
|
68
68
|
* @see https://katex.org/docs/options
|
|
69
|
-
*
|
|
69
|
+
*
|
|
70
70
|
* @default false
|
|
71
71
|
*/
|
|
72
72
|
displayMode?: boolean;
|
|
@@ -76,21 +76,21 @@ export interface KatexOptions {
|
|
|
76
76
|
* - `mathml`: Outputs KaTeX in MathML only.
|
|
77
77
|
* - `htmlAndMathml`: Outputs HTML for visual rendering and includes MathML
|
|
78
78
|
* for accessibility.
|
|
79
|
-
*
|
|
79
|
+
*
|
|
80
80
|
* @default "htmlAndMathml"
|
|
81
81
|
*/
|
|
82
82
|
output?: "html" | "mathml" | "htmlAndMathml";
|
|
83
83
|
/**
|
|
84
84
|
* If `true`, display math has `\tag`s rendered on the left instead of the
|
|
85
85
|
* right, like `\usepackage[leqno]{amsmath}` in LaTeX.
|
|
86
|
-
*
|
|
86
|
+
*
|
|
87
87
|
* @default false
|
|
88
88
|
*/
|
|
89
89
|
leqno?: boolean;
|
|
90
90
|
/**
|
|
91
91
|
* If `true`, display math renders flush left with a `2em` left margin,
|
|
92
92
|
* like `\documentclass[fleqn]` in LaTeX with the `amsmath` package.
|
|
93
|
-
*
|
|
93
|
+
*
|
|
94
94
|
* @default false
|
|
95
95
|
*/
|
|
96
96
|
fleqn?: boolean;
|
|
@@ -100,7 +100,7 @@ export interface KatexOptions {
|
|
|
100
100
|
* If `false`, KaTeX will render unsupported commands as text, and render
|
|
101
101
|
* invalid LaTeX as its source code with hover text giving the error, in
|
|
102
102
|
* the color given by `errorColor`.
|
|
103
|
-
*
|
|
103
|
+
*
|
|
104
104
|
* @default true
|
|
105
105
|
*/
|
|
106
106
|
throwOnError?: boolean;
|
|
@@ -108,7 +108,7 @@ export interface KatexOptions {
|
|
|
108
108
|
* A color string given in the format `"#XXX"` or `"#XXXXXX"`. This option
|
|
109
109
|
* determines the color that unsupported commands and invalid LaTeX are
|
|
110
110
|
* rendered in when `throwOnError` is set to `false`.
|
|
111
|
-
*
|
|
111
|
+
*
|
|
112
112
|
* @default "#cc0000"
|
|
113
113
|
*/
|
|
114
114
|
errorColor?: string;
|
|
@@ -116,7 +116,8 @@ export interface KatexOptions {
|
|
|
116
116
|
* A collection of custom macros.
|
|
117
117
|
* @see https://katex.org/docs/options
|
|
118
118
|
*/
|
|
119
|
-
macros?: Record<string, string | object | ((macroExpander:object)
|
|
119
|
+
macros?: Record<string, string | object | ((macroExpander:object)
|
|
120
|
+
=> string | object)>;
|
|
120
121
|
/**
|
|
121
122
|
* Specifies a minimum thickness, in ems, for fraction lines, `\sqrt` top
|
|
122
123
|
* lines, `{array}` vertical lines, `\hline`, `\hdashline`, `\underline`,
|
|
@@ -138,7 +139,7 @@ export interface KatexOptions {
|
|
|
138
139
|
* All user-specified sizes, e.g. in `\rule{500em}{500em}`, will be capped
|
|
139
140
|
* to `maxSize` ems. If set to `Infinity` (the default), users can make
|
|
140
141
|
* elements and spaces arbitrarily large.
|
|
141
|
-
*
|
|
142
|
+
*
|
|
142
143
|
* @default Infinity
|
|
143
144
|
*/
|
|
144
145
|
maxSize?: number;
|
|
@@ -147,7 +148,7 @@ export interface KatexOptions {
|
|
|
147
148
|
* e.g. infinite macro loops. `\edef` expansion counts all expanded tokens.
|
|
148
149
|
* If set to `Infinity`, the macro expander will try to fully expand as in
|
|
149
150
|
* LaTeX.
|
|
150
|
-
*
|
|
151
|
+
*
|
|
151
152
|
* @default 1000
|
|
152
153
|
*/
|
|
153
154
|
maxExpand?: number;
|
|
@@ -164,7 +165,7 @@ export interface KatexOptions {
|
|
|
164
165
|
* can also return `"ignore"`, `"error"`, or `"warn"` to use a built-in
|
|
165
166
|
* behavior.
|
|
166
167
|
* @see https://katex.org/docs/options
|
|
167
|
-
*
|
|
168
|
+
*
|
|
168
169
|
* @default "warn"
|
|
169
170
|
*/
|
|
170
171
|
strict?:
|
|
@@ -179,7 +180,7 @@ export interface KatexOptions {
|
|
|
179
180
|
* Provide a custom function `handler(context)` to customize behavior
|
|
180
181
|
* depending on the context (command, arguments e.g. a URL, etc.).
|
|
181
182
|
* @see https://katex.org/docs/options
|
|
182
|
-
*
|
|
183
|
+
*
|
|
183
184
|
* @default false
|
|
184
185
|
*/
|
|
185
186
|
trust?: boolean | ((context: TrustContext) => boolean);
|
|
@@ -190,7 +191,7 @@ export interface KatexOptions {
|
|
|
190
191
|
* constructs such as `\begin{equation}` and `$$` create a local group and
|
|
191
192
|
* prevent definitions other than `\gdef` from becoming visible outside of
|
|
192
193
|
* those blocks, so this is KaTeX's default behavior.
|
|
193
|
-
*
|
|
194
|
+
*
|
|
194
195
|
* @default false
|
|
195
196
|
*/
|
|
196
197
|
globalGroup?: boolean;
|