@mdit/plugin-mathjax-slim 0.24.0 → 0.25.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.
- package/lib/importer-DDxrj6yI.js +1 -0
- package/lib/importer-N3BdKsx_.js +1 -0
- package/lib/index.d.ts +400 -266
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/sync.d.ts +402 -266
- package/lib/sync.js +2 -2
- package/lib/sync.js.map +1 -1
- package/package.json +22 -17
- package/lib/importer-C5KF-eLj.js +0 -2
- package/lib/importer-C5KF-eLj.js.map +0 -1
package/lib/sync.d.ts
CHANGED
|
@@ -1,296 +1,432 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LiteAdaptor } from
|
|
3
|
-
import { TeX } from
|
|
4
|
-
import { CHTML } from
|
|
5
|
-
import { SVG } from
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { MmlNode } from
|
|
9
|
-
import TexError from
|
|
1
|
+
import { MarkdownItTexOptions } from "@mdit/plugin-tex";
|
|
2
|
+
import { LiteAdaptor } from "@mathjax/src/cjs/adaptors/liteAdaptor.js";
|
|
3
|
+
import { TeX } from "@mathjax/src/cjs/input/tex.js";
|
|
4
|
+
import { CHTML } from "@mathjax/src/cjs/output/chtml.js";
|
|
5
|
+
import { SVG } from "@mathjax/src/cjs/output/svg.js";
|
|
6
|
+
import { LiteElement } from "@mathjax/src/cjs/adaptors/lite/Element.js";
|
|
7
|
+
import MarkdownIt from "markdown-it";
|
|
8
|
+
import { MmlNode } from "@mathjax/src/js/core/MmlTree/MmlNode.js";
|
|
9
|
+
import TexError from "@mathjax/src/js/input/tex/TexError.js";
|
|
10
|
+
import { TeX as TeX$1 } from "@mathjax/src/js/input/tex.js";
|
|
11
|
+
import { ChtmlFontData } from "@mathjax/src/js/output/chtml/FontData.js";
|
|
12
|
+
import { SvgFontData } from "@mathjax/src/js/output/svg/FontData.js";
|
|
13
|
+
import { MathItem } from "@mathjax/src/js/core/MathItem.js";
|
|
14
|
+
import { LiteElement as LiteElement$1 } from "@mathjax/src/js/adaptors/lite/Element.js";
|
|
15
|
+
import { MathDocument } from "@mathjax/src/js/core/MathDocument.js";
|
|
16
|
+
import { CssStyles } from "@mathjax/src/js/ui/menu/mj-context-menu.js";
|
|
17
|
+
import { LinebreakVisitor } from "@mathjax/src/js/output/common/LinebreakVisitor.js";
|
|
18
|
+
import { SvgWrapperFactory } from "@mathjax/src/js/output/svg/WrapperFactory.js";
|
|
19
|
+
import { ChtmlWrapperFactory } from "@mathjax/src/js/output/chtml/WrapperFactory.js";
|
|
10
20
|
|
|
21
|
+
//#region src/mathjax.d.ts
|
|
11
22
|
type TexPackage = "action" | "ams" | "amscd" | "bbm" | "bboldx" | "bbox" | "begingroup" | "boldsymbol" | "braket" | "bussproofs" | "cancel" | "cases" | "centernot" | "color" | "colortbl" | "colorv2" | "configmacros" | "dsfont" | "empheq" | "enclose" | "extpfeil" | "gensymb" | "html" | "mathtools" | "mhchem" | "newcommand" | "noerrors" | "noundefined" | "physics" | "setoptions" | "tagformat" | "texhtml" | "textcomp" | "textmacros" | "unicode" | "units" | "upgreek" | "verb";
|
|
12
23
|
interface MathJaxTexInputOptions {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
24
|
+
/**
|
|
25
|
+
* extensions to use
|
|
26
|
+
*
|
|
27
|
+
* @default [
|
|
28
|
+
* 'action',
|
|
29
|
+
* 'ams',
|
|
30
|
+
* 'amscd',
|
|
31
|
+
* 'bbm',
|
|
32
|
+
* 'bboldx',
|
|
33
|
+
* 'bbox',
|
|
34
|
+
* 'begingroup',
|
|
35
|
+
* 'boldsymbol',
|
|
36
|
+
* 'braket',
|
|
37
|
+
* 'bussproofs',
|
|
38
|
+
* 'cancel',
|
|
39
|
+
* 'cases',
|
|
40
|
+
* 'centernot',
|
|
41
|
+
* 'color',
|
|
42
|
+
* 'colortbl',
|
|
43
|
+
* 'colorv2',
|
|
44
|
+
* 'configmacros',
|
|
45
|
+
* 'dsfont',
|
|
46
|
+
* 'empheq',
|
|
47
|
+
* 'enclose',
|
|
48
|
+
* 'extpfeil',
|
|
49
|
+
* 'gensymb',
|
|
50
|
+
* 'html',
|
|
51
|
+
* 'mathtools',
|
|
52
|
+
* 'mhchem',
|
|
53
|
+
* 'newcommand',
|
|
54
|
+
* 'noerrors',
|
|
55
|
+
* 'noundefined',
|
|
56
|
+
* 'physics',
|
|
57
|
+
* 'require',
|
|
58
|
+
* 'setoptions',
|
|
59
|
+
* 'tagformat',
|
|
60
|
+
* 'texhtml',
|
|
61
|
+
* 'textcomp',
|
|
62
|
+
* 'textmacros',
|
|
63
|
+
* 'unicode',
|
|
64
|
+
* 'units',
|
|
65
|
+
* 'upgreek',
|
|
66
|
+
* 'verb',
|
|
67
|
+
* ]
|
|
68
|
+
*/
|
|
69
|
+
packages?: TexPackage[];
|
|
70
|
+
/**
|
|
71
|
+
* pattern for recognizing numbers
|
|
72
|
+
*
|
|
73
|
+
* @default /^(?:[0-9]+(?:\{,\}[0-9]{3})*(?:\.[0-9]*)?|\.[0-9]+)/
|
|
74
|
+
*/
|
|
75
|
+
digits?: RegExp;
|
|
76
|
+
tags?: "ams" | "all" | "none";
|
|
77
|
+
/**
|
|
78
|
+
* side for `\tag` macros
|
|
79
|
+
*/
|
|
80
|
+
tagSide?: "left" | "right";
|
|
81
|
+
/**
|
|
82
|
+
* amount to indent tags
|
|
83
|
+
*
|
|
84
|
+
* @default "0.8em"
|
|
85
|
+
*/
|
|
86
|
+
tagIndent?: "0.8em";
|
|
87
|
+
/**
|
|
88
|
+
* use label name rather than tag for ids
|
|
89
|
+
*
|
|
90
|
+
* @default true;
|
|
91
|
+
*/
|
|
92
|
+
useLabelIds?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* maximum number of macro substitutions per expression
|
|
95
|
+
*
|
|
96
|
+
* @default 1000
|
|
97
|
+
*/
|
|
98
|
+
maxMacros?: number;
|
|
99
|
+
/**
|
|
100
|
+
* maximum size for the internal TeX string (in bytes)
|
|
101
|
+
*
|
|
102
|
+
* @default 5120
|
|
103
|
+
*/
|
|
104
|
+
maxBuffer?: number;
|
|
105
|
+
formatError?: (jax: TeX$1<unknown, unknown, unknown>, error: typeof TexError) => MmlNode;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Data passed to MathJax filters
|
|
109
|
+
*/
|
|
110
|
+
interface MathjaxFilterData {
|
|
111
|
+
math: MathItem<LiteElement$1, string, HTMLElement>;
|
|
112
|
+
document: MathDocument<LiteElement$1, string, HTMLElement>;
|
|
113
|
+
data: any;
|
|
96
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* MathJax filter function
|
|
117
|
+
*/
|
|
118
|
+
type MathjaxFilter = (data: MathjaxFilterData) => void;
|
|
119
|
+
/**
|
|
120
|
+
* @see https://docs.mathjax.org/en/latest/options/output/index.html#option-descriptions
|
|
121
|
+
*/
|
|
97
122
|
interface MathjaxCommonOutputOptions {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
123
|
+
/**
|
|
124
|
+
* Global scaling factor for all expressions
|
|
125
|
+
*
|
|
126
|
+
* @default 1
|
|
127
|
+
*/
|
|
128
|
+
scale?: number;
|
|
129
|
+
/**
|
|
130
|
+
* smallest scaling factor to use
|
|
131
|
+
*
|
|
132
|
+
* @default 0.5
|
|
133
|
+
*/
|
|
134
|
+
minScale?: number;
|
|
135
|
+
/**
|
|
136
|
+
* make mtext elements use surrounding font
|
|
137
|
+
*
|
|
138
|
+
* @default false
|
|
139
|
+
*/
|
|
140
|
+
mtextInheritFont?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* make merror text use surrounding font
|
|
143
|
+
*
|
|
144
|
+
* @default true
|
|
145
|
+
*/
|
|
146
|
+
merrorInheritFont?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* font to use for mtext, if not inheriting (empty means use MathJax fonts)
|
|
149
|
+
*
|
|
150
|
+
* @default ""
|
|
151
|
+
*/
|
|
152
|
+
mtextFont?: string;
|
|
153
|
+
/**
|
|
154
|
+
* font to use for merror, if not inheriting (empty means use MathJax fonts)
|
|
155
|
+
*
|
|
156
|
+
* @default "serif"
|
|
157
|
+
*/
|
|
158
|
+
merrorFont?: string;
|
|
159
|
+
/**
|
|
160
|
+
* font to use for character that aren’t in MathJax's fonts
|
|
161
|
+
*
|
|
162
|
+
* @default "serif"
|
|
163
|
+
*/
|
|
164
|
+
unknownFamily?: string;
|
|
165
|
+
/**
|
|
166
|
+
* - `true` for MathML spacing rules
|
|
167
|
+
* - `false` for TeX rules
|
|
168
|
+
*
|
|
169
|
+
* @default false
|
|
170
|
+
*/
|
|
171
|
+
mathmlSpacing?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* RFDa and other attributes NOT to copy to the output
|
|
174
|
+
*/
|
|
175
|
+
skipAttributes?: Record<string, boolean>;
|
|
176
|
+
/**
|
|
177
|
+
* default size of ex in em units
|
|
178
|
+
*
|
|
179
|
+
* @default 0.5
|
|
180
|
+
*/
|
|
181
|
+
exFactor?: number;
|
|
182
|
+
/**
|
|
183
|
+
* default for indentalign when set to 'auto'
|
|
184
|
+
*
|
|
185
|
+
* @default "center"
|
|
186
|
+
*/
|
|
187
|
+
displayAlign?: "left" | "center" | "right";
|
|
188
|
+
/**
|
|
189
|
+
* default for indentshift when set to 'auto'
|
|
190
|
+
*
|
|
191
|
+
* @default 0
|
|
192
|
+
*/
|
|
193
|
+
displayIndent?: string;
|
|
194
|
+
/**
|
|
195
|
+
* default for overflow
|
|
196
|
+
*
|
|
197
|
+
* @default "overflow"
|
|
198
|
+
*/
|
|
199
|
+
displayOverflow?: "scroll" | "scale" | "truncate" | "elide" | "linebreak" | "overflow";
|
|
200
|
+
/**
|
|
201
|
+
* options for when overflow is linebreak
|
|
202
|
+
*/
|
|
203
|
+
linebreaks?: {
|
|
204
|
+
/**
|
|
205
|
+
* true for browser-based breaking of inline equations
|
|
118
206
|
*
|
|
119
207
|
* @default true
|
|
120
208
|
*/
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* font to use for mtext, if not inheriting (empty means use MathJax fonts)
|
|
124
|
-
*
|
|
125
|
-
* @default ""
|
|
126
|
-
*/
|
|
127
|
-
mtextFont?: string;
|
|
128
|
-
/**
|
|
129
|
-
* font to use for merror, if not inheriting (empty means use MathJax fonts)
|
|
130
|
-
*
|
|
131
|
-
* @default "serif"
|
|
132
|
-
*/
|
|
133
|
-
merrorFont?: string;
|
|
209
|
+
inline?: boolean;
|
|
134
210
|
/**
|
|
135
|
-
*
|
|
211
|
+
* a fixed size or a percentage of the container width
|
|
136
212
|
*
|
|
137
|
-
* @default "
|
|
213
|
+
* @default "100%"
|
|
138
214
|
*/
|
|
139
|
-
|
|
215
|
+
width?: string;
|
|
140
216
|
/**
|
|
141
|
-
*
|
|
142
|
-
*/
|
|
143
|
-
displayAlign?: "left" | "center" | "right";
|
|
144
|
-
/**
|
|
145
|
-
* @default 0
|
|
146
|
-
*/
|
|
147
|
-
displayIndent?: string;
|
|
148
|
-
/**
|
|
149
|
-
* - `true` for MathML spacing rules
|
|
150
|
-
* - `false` for TeX rules
|
|
151
|
-
*
|
|
152
|
-
* @default false
|
|
153
|
-
*/
|
|
154
|
-
mathmlSpacing?: boolean;
|
|
155
|
-
/**
|
|
156
|
-
* RFDa and other attributes NOT to copy to the output
|
|
157
|
-
*/
|
|
158
|
-
skipAttributes?: Record<string, boolean>;
|
|
159
|
-
/**
|
|
160
|
-
* default size of ex in em units
|
|
217
|
+
* the default lineleading in em units
|
|
161
218
|
*
|
|
162
|
-
* @default 0.
|
|
163
|
-
*/
|
|
164
|
-
|
|
219
|
+
* @default 0.2
|
|
220
|
+
*/
|
|
221
|
+
lineleading?: number;
|
|
222
|
+
/**
|
|
223
|
+
* for developers only
|
|
224
|
+
*/
|
|
225
|
+
LinebreakVisitor?: typeof LinebreakVisitor;
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* the font component to load
|
|
229
|
+
*
|
|
230
|
+
* @default ""
|
|
231
|
+
*/
|
|
232
|
+
font?: string;
|
|
233
|
+
/**
|
|
234
|
+
* The path to the font definitions
|
|
235
|
+
*
|
|
236
|
+
* @default "https://cdn.jsdelivr.net/npm/@mathjax/mathjax-newcm-font/"
|
|
237
|
+
*/
|
|
238
|
+
fontPath?: string;
|
|
239
|
+
/**
|
|
240
|
+
* The font extensions to load
|
|
241
|
+
*
|
|
242
|
+
* @default []
|
|
243
|
+
*/
|
|
244
|
+
fontExtensions?: string[];
|
|
245
|
+
/**
|
|
246
|
+
* 'use', 'force', or 'ignore' data-mjx-hdw attributes
|
|
247
|
+
*
|
|
248
|
+
* @default "auto"
|
|
249
|
+
*/
|
|
250
|
+
htmlHDW?: "use" | "force" | "ignore";
|
|
251
|
+
/**
|
|
252
|
+
* A list of pre-filters to add to the output jax
|
|
253
|
+
*
|
|
254
|
+
* @default []
|
|
255
|
+
*/
|
|
256
|
+
preFilters?: MathjaxFilter[];
|
|
257
|
+
/**
|
|
258
|
+
* A list of post-filters to add to the output jax
|
|
259
|
+
*
|
|
260
|
+
* @default []
|
|
261
|
+
*/
|
|
262
|
+
postFilters?: MathjaxFilter[];
|
|
263
|
+
/**
|
|
264
|
+
* for developers only
|
|
265
|
+
*/
|
|
266
|
+
cssStyles?: typeof CssStyles;
|
|
165
267
|
}
|
|
166
268
|
interface MathjaxCommonHTMLOutputOptions extends MathjaxCommonOutputOptions {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
269
|
+
/**
|
|
270
|
+
* Whether match ex-height of surrounding font
|
|
271
|
+
*
|
|
272
|
+
* @default true
|
|
273
|
+
*/
|
|
274
|
+
matchFontHeight?: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* Font data to use
|
|
277
|
+
*
|
|
278
|
+
* @default font data from `@mathjax/mathjax-newcm-font`
|
|
279
|
+
*/
|
|
280
|
+
fontData?: typeof ChtmlFontData;
|
|
281
|
+
/**
|
|
282
|
+
* The URL where the fonts are found
|
|
283
|
+
*
|
|
284
|
+
* @default jsdelivr CDN links for `@mathjax/mathjax-newcm-font`
|
|
285
|
+
*/
|
|
286
|
+
fontURL?: string;
|
|
287
|
+
/**
|
|
288
|
+
* location where MathJax should look for font data that has to be loaded dynamically.
|
|
289
|
+
*
|
|
290
|
+
* @default jsdelivr CDN links for `@mathjax/mathjax-newcm-font`
|
|
291
|
+
*/
|
|
292
|
+
dynamicPrefix?: string;
|
|
293
|
+
/**
|
|
294
|
+
* Whether only produce CSS that is used in the processed equations
|
|
295
|
+
*
|
|
296
|
+
* @default true
|
|
297
|
+
*/
|
|
298
|
+
adaptiveCSS?: boolean;
|
|
299
|
+
/**
|
|
300
|
+
* for developers only
|
|
301
|
+
*/
|
|
302
|
+
wrapperFactory?: typeof ChtmlWrapperFactory;
|
|
185
303
|
}
|
|
186
304
|
interface MathjaxSVGOutputOptions extends MathjaxCommonOutputOptions {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
305
|
+
/**
|
|
306
|
+
* stroke-width to use for SVG character paths in units that are 1/1000 of an em
|
|
307
|
+
*
|
|
308
|
+
* @default 3
|
|
309
|
+
*/
|
|
310
|
+
blacker?: number;
|
|
311
|
+
/**
|
|
312
|
+
* @see https://docs.mathjax.org/en/latest/options/output/svg.html#option-descriptions
|
|
313
|
+
* @default "local"
|
|
314
|
+
*/
|
|
315
|
+
fontCache?: "local" | "global" | "none";
|
|
316
|
+
/**
|
|
317
|
+
* Font data to use
|
|
318
|
+
*
|
|
319
|
+
* @default font data from `@mathjax/mathjax-newcm-font`
|
|
320
|
+
*/
|
|
321
|
+
fontData?: typeof SvgFontData;
|
|
322
|
+
/**
|
|
323
|
+
* Whether the xlink namespace should be included in the href attributes or not
|
|
324
|
+
*
|
|
325
|
+
* @default true
|
|
326
|
+
*/
|
|
327
|
+
useXlink?: boolean;
|
|
328
|
+
/**
|
|
329
|
+
* ID to use for local font cache (for single equation processing)
|
|
330
|
+
*/
|
|
331
|
+
localID?: string | null;
|
|
332
|
+
/**
|
|
333
|
+
* for developers only
|
|
334
|
+
*/
|
|
335
|
+
wrapperFactory?: typeof SvgWrapperFactory;
|
|
205
336
|
}
|
|
206
|
-
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region src/options.d.ts
|
|
207
339
|
type TeXTransformer = (content: string, displayMode: boolean) => string;
|
|
208
340
|
interface MarkdownItMathjaxOptions extends Pick<MarkdownItTexOptions, "allowInlineWithSpace" | "delimiters" | "mathFence"> {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
341
|
+
/**
|
|
342
|
+
* Output syntax
|
|
343
|
+
*
|
|
344
|
+
* 输出格式
|
|
345
|
+
*
|
|
346
|
+
* @default 'svg'
|
|
347
|
+
*/
|
|
348
|
+
output?: "chtml" | "svg";
|
|
349
|
+
/**
|
|
350
|
+
* Enable A11y
|
|
351
|
+
*
|
|
352
|
+
* 是否启用无障碍
|
|
353
|
+
*
|
|
354
|
+
* @default true
|
|
355
|
+
*/
|
|
356
|
+
a11y?: boolean;
|
|
357
|
+
/**
|
|
358
|
+
* TeX input options
|
|
359
|
+
*
|
|
360
|
+
* TeX 输入选项
|
|
361
|
+
*/
|
|
362
|
+
tex?: MathJaxTexInputOptions;
|
|
363
|
+
/**
|
|
364
|
+
* Common HTML output options
|
|
365
|
+
*
|
|
366
|
+
* 通用 HTML 输出选项
|
|
367
|
+
*/
|
|
368
|
+
chtml?: MathjaxCommonHTMLOutputOptions;
|
|
369
|
+
/**
|
|
370
|
+
* SVG output options
|
|
371
|
+
*
|
|
372
|
+
* SVG 输出选项
|
|
373
|
+
*/
|
|
374
|
+
svg?: MathjaxSVGOutputOptions;
|
|
375
|
+
/**
|
|
376
|
+
* transformer on output content
|
|
377
|
+
*
|
|
378
|
+
* 输出内容的转换器
|
|
379
|
+
*/
|
|
380
|
+
transformer?: TeXTransformer;
|
|
249
381
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
* Forked from https://github.com/tani/markdown-it-mathjax3/blob/master/index.ts
|
|
253
|
-
*/
|
|
254
|
-
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region src/sync.d.ts
|
|
255
384
|
interface DocumentOptions {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
385
|
+
InputJax: TeX<LiteElement, string, HTMLElement>;
|
|
386
|
+
OutputJax: CHTML<LiteElement, string, HTMLElement> | SVG<LiteElement, string, HTMLElement>;
|
|
387
|
+
enableAssistiveMml: boolean;
|
|
259
388
|
}
|
|
260
389
|
declare const getDocumentOptions: (options: MarkdownItMathjaxOptions) => DocumentOptions;
|
|
261
390
|
/**
|
|
262
391
|
* Mathjax instance
|
|
263
392
|
*/
|
|
264
393
|
interface MathjaxInstance extends Required<Pick<MarkdownItMathjaxOptions, "allowInlineWithSpace" | "delimiters" | "mathFence">> {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
394
|
+
/**
|
|
395
|
+
* Mathjax adaptor
|
|
396
|
+
*/
|
|
397
|
+
adaptor: LiteAdaptor;
|
|
398
|
+
/**
|
|
399
|
+
* Mathjax document options
|
|
400
|
+
*/
|
|
401
|
+
documentOptions: DocumentOptions;
|
|
402
|
+
/**
|
|
403
|
+
* Clear style cache
|
|
404
|
+
*/
|
|
405
|
+
clearStyle: () => void;
|
|
406
|
+
/**
|
|
407
|
+
* Output style for rendered content and clears it
|
|
408
|
+
*
|
|
409
|
+
* @returns style
|
|
410
|
+
*/
|
|
411
|
+
outputStyle: () => string;
|
|
412
|
+
/**
|
|
413
|
+
* Reset tex (including labels)
|
|
414
|
+
*/
|
|
415
|
+
reset: () => void;
|
|
416
|
+
/**
|
|
417
|
+
* Output content transformer
|
|
418
|
+
*/
|
|
419
|
+
transformer: TeXTransformer | null;
|
|
291
420
|
}
|
|
292
421
|
declare const createMathjaxInstance: (options?: MarkdownItMathjaxOptions) => MathjaxInstance | null;
|
|
293
|
-
declare const mathjax: (md: MarkdownIt, {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
422
|
+
declare const mathjax: (md: MarkdownIt, {
|
|
423
|
+
allowInlineWithSpace,
|
|
424
|
+
adaptor,
|
|
425
|
+
delimiters,
|
|
426
|
+
documentOptions,
|
|
427
|
+
mathFence,
|
|
428
|
+
transformer
|
|
429
|
+
}: MathjaxInstance) => void;
|
|
430
|
+
//#endregion
|
|
431
|
+
export { DocumentOptions, MathjaxInstance, createMathjaxInstance, getDocumentOptions, mathjax };
|
|
432
|
+
//# sourceMappingURL=sync.d.ts.map
|