vitepress-plugin-sfc 2.0.0-beta.2 → 2.0.0-beta.4
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 +20 -4
- package/dist/GroupTabs-voGdJiur.mjs +1 -0
- package/dist/client.d.mts +2 -0
- package/dist/client.mjs +1 -0
- package/dist/export-helper-9pbmIWWh.mjs +1 -0
- package/dist/index-DHKDP_Um.d.mts +22 -0
- package/dist/index.d.mts +10 -1067
- package/dist/index.mjs +5 -5
- package/dist/style.css +58 -0
- package/package.json +16 -9
- package/src/client/ComponentView.vue +0 -165
- package/src/client/index.ts +0 -23
- package/src/client/useLocaleMappings.ts +0 -31
package/dist/index.d.mts
CHANGED
|
@@ -1,1084 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { t as ComponentViewProps } from "./index-DHKDP_Um.mjs";
|
|
2
|
+
import { MarkdownEnv, MarkdownRenderer, Plugin, SfcBlock } from "vitepress";
|
|
3
3
|
|
|
4
|
-
//#region \0rolldown/runtime.js
|
|
5
|
-
declare namespace index_d_exports$1 {
|
|
6
|
-
export { Url, decode, encode, format, parse };
|
|
7
|
-
}
|
|
8
|
-
interface Url {
|
|
9
|
-
protocol: string | null;
|
|
10
|
-
slashes: boolean | null;
|
|
11
|
-
auth: string | null;
|
|
12
|
-
port: string | null;
|
|
13
|
-
hostname: string | null;
|
|
14
|
-
hash: string | null;
|
|
15
|
-
search: string | null;
|
|
16
|
-
pathname: string | null;
|
|
17
|
-
}
|
|
18
|
-
declare function decode(string: string, exclude?: string): string;
|
|
19
|
-
declare namespace decode {
|
|
20
|
-
let defaultChars: string;
|
|
21
|
-
let componentChars: string;
|
|
22
|
-
}
|
|
23
|
-
declare function encode(string: string, keepEscaped?: boolean): string;
|
|
24
|
-
declare function encode(string: string, exclude: string, keepEscaped?: boolean): string;
|
|
25
|
-
declare namespace encode {
|
|
26
|
-
let defaultChars: string;
|
|
27
|
-
let componentChars: string;
|
|
28
|
-
}
|
|
29
|
-
declare function format(url: Url): string;
|
|
30
|
-
declare function parse(url: string, slashesDenoteHost?: boolean): Url;
|
|
31
|
-
declare namespace utils_d_exports {
|
|
32
|
-
export { arrayReplaceAt, assign, escapeHtml, escapeRE, fromCodePoint, has, isMdAsciiPunct, isPunctChar, isPunctCharCode, isSpace, isString, isValidEntityCode, isWhiteSpace, lib, normalizeReference, unescapeAll, unescapeMd };
|
|
33
|
-
}
|
|
34
|
-
// import * as ucmicro from "uc.micro";
|
|
35
|
-
declare const lib: {
|
|
36
|
-
mdurl: typeof index_d_exports$1;
|
|
37
|
-
ucmicro: any;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Merge objects
|
|
41
|
-
*/
|
|
42
|
-
declare function assign(obj: any, ...from: any[]): any;
|
|
43
|
-
declare function isString(obj: any): obj is string;
|
|
44
|
-
declare function has(obj: any, key: keyof any): boolean;
|
|
45
|
-
declare function unescapeMd(str: string): string;
|
|
46
|
-
declare function unescapeAll(str: string): string;
|
|
47
|
-
declare function isValidEntityCode(c: number): boolean;
|
|
48
|
-
declare function fromCodePoint(c: number): string;
|
|
49
|
-
declare function escapeHtml(str: string): string;
|
|
50
|
-
/**
|
|
51
|
-
* Remove element from array and put another array at those position.
|
|
52
|
-
* Useful for some operations with tokens
|
|
53
|
-
*/
|
|
54
|
-
declare function arrayReplaceAt<T>(src: T[], pos: number, newElements: T[]): T[];
|
|
55
|
-
declare function isSpace(code: number): boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Zs (unicode class) || [\t\f\v\r\n]
|
|
58
|
-
*/
|
|
59
|
-
declare function isWhiteSpace(code: number): boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Markdown [ASCII punctuation characters](https://spec.commonmark.org/0.31.2/#ascii-punctuation-character).
|
|
62
|
-
*
|
|
63
|
-
* !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, \@, [, \\, ], ^, _, `, {, |, }, or ~
|
|
64
|
-
*
|
|
65
|
-
* {@link isPunctChar} is missing some ASCII punctuation chars in < 14.1.0.
|
|
66
|
-
* This is consistent with CommonMark 0.30 and older behavior, where the range of ASCII punctuation
|
|
67
|
-
* characters was not fully contained in that of
|
|
68
|
-
* [Unicode punctuation characters](https://spec.commonmark.org/0.31.2/#unicode-punctuation-character).
|
|
69
|
-
*
|
|
70
|
-
* In >= 14.1.0 (compliant with CommonMark 0.31.2), {@link isPunctChar} includes all ASCII punctuation characters,
|
|
71
|
-
* so combining {@link isMdAsciiPunct} with {@link isPunctChar} is only for backwards compatibility or
|
|
72
|
-
* to try to provide a fast path for ASCII ranges.
|
|
73
|
-
*
|
|
74
|
-
* @see https://spec.commonmark.org/0.31.2/changes.html#part-4
|
|
75
|
-
*/
|
|
76
|
-
declare function isMdAsciiPunct(code: number): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* [Unicode punctuation characters](https://spec.commonmark.org/0.31.2/#unicode-punctuation-character).
|
|
79
|
-
*
|
|
80
|
-
* Astral (supplementary) characters support requires >= 14.2.0.
|
|
81
|
-
*/
|
|
82
|
-
declare function isPunctChar(ch: string): boolean;
|
|
83
|
-
/**
|
|
84
|
-
* [Unicode punctuation characters](https://spec.commonmark.org/0.31.2/#unicode-punctuation-character).
|
|
85
|
-
*
|
|
86
|
-
* Added in 14.2.0. Supports astral (supplementary) characters.
|
|
87
|
-
*/
|
|
88
|
-
declare function isPunctCharCode(code: number): boolean;
|
|
89
|
-
declare function escapeRE(str: string): string;
|
|
90
|
-
/**
|
|
91
|
-
* Helper to unify [reference labels].
|
|
92
|
-
*/
|
|
93
|
-
declare function normalizeReference(str: string): string;
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region node_modules/.pnpm/@types+markdown-it@14.2.0/node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.mts
|
|
96
|
-
interface ParseLinkDestinationResult {
|
|
97
|
-
ok: boolean;
|
|
98
|
-
pos: number;
|
|
99
|
-
str: string;
|
|
100
|
-
}
|
|
101
|
-
declare function parseLinkDestination(str: string, start: number, max: number): ParseLinkDestinationResult;
|
|
102
|
-
//#endregion
|
|
103
|
-
//#region node_modules/.pnpm/@types+markdown-it@14.2.0/node_modules/@types/markdown-it/lib/token.d.mts
|
|
104
|
-
type Nesting = 1 | 0 | -1;
|
|
105
|
-
declare class Token {
|
|
106
|
-
/**
|
|
107
|
-
* Create new token and fill passed properties.
|
|
108
|
-
*/
|
|
109
|
-
constructor(type: string, tag: string, nesting: Nesting);
|
|
110
|
-
/**
|
|
111
|
-
* Type of the token, e.g. "paragraph_open"
|
|
112
|
-
*/
|
|
113
|
-
type: string;
|
|
114
|
-
/**
|
|
115
|
-
* HTML tag name, e.g. "p"
|
|
116
|
-
*/
|
|
117
|
-
tag: string;
|
|
118
|
-
/**
|
|
119
|
-
* HTML attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`
|
|
120
|
-
*/
|
|
121
|
-
attrs: Array<[string, string]> | null;
|
|
122
|
-
/**
|
|
123
|
-
* Source map info. Format: `[ line_begin, line_end ]`
|
|
124
|
-
*/
|
|
125
|
-
map: [number, number] | null;
|
|
126
|
-
/**
|
|
127
|
-
* Level change (number in {-1, 0, 1} set), where:
|
|
128
|
-
*
|
|
129
|
-
* - `1` means the tag is opening
|
|
130
|
-
* - `0` means the tag is self-closing
|
|
131
|
-
* - `-1` means the tag is closing
|
|
132
|
-
*/
|
|
133
|
-
nesting: Nesting;
|
|
134
|
-
/**
|
|
135
|
-
* Nesting level, the same as `state.level`
|
|
136
|
-
*/
|
|
137
|
-
level: number;
|
|
138
|
-
/**
|
|
139
|
-
* An array of child nodes (inline and img tokens)
|
|
140
|
-
*/
|
|
141
|
-
children: Token[] | null;
|
|
142
|
-
/**
|
|
143
|
-
* In a case of self-closing tag (code, html, fence, etc.),
|
|
144
|
-
* it has contents of this tag.
|
|
145
|
-
*/
|
|
146
|
-
content: string;
|
|
147
|
-
/**
|
|
148
|
-
* '*' or '_' for emphasis, fence string for fence, etc.
|
|
149
|
-
*/
|
|
150
|
-
markup: string;
|
|
151
|
-
/**
|
|
152
|
-
* - Info string for "fence" tokens
|
|
153
|
-
* - The value "auto" for autolink "link_open" and "link_close" tokens
|
|
154
|
-
* - The string value of the item marker for ordered-list "list_item_open" tokens
|
|
155
|
-
*/
|
|
156
|
-
info: string;
|
|
157
|
-
/**
|
|
158
|
-
* A place for plugins to store an arbitrary data
|
|
159
|
-
*/
|
|
160
|
-
meta: any;
|
|
161
|
-
/**
|
|
162
|
-
* True for block-level tokens, false for inline tokens.
|
|
163
|
-
* Used in renderer to calculate line breaks
|
|
164
|
-
*/
|
|
165
|
-
block: boolean;
|
|
166
|
-
/**
|
|
167
|
-
* If it's true, ignore this element when rendering. Used for tight lists
|
|
168
|
-
* to hide paragraphs.
|
|
169
|
-
*/
|
|
170
|
-
hidden: boolean;
|
|
171
|
-
/**
|
|
172
|
-
* Search attribute index by name.
|
|
173
|
-
*/
|
|
174
|
-
attrIndex(name: string): number;
|
|
175
|
-
/**
|
|
176
|
-
* Add `[ name, value ]` attribute to list. Init attrs if necessary
|
|
177
|
-
*/
|
|
178
|
-
attrPush(attrData: [string, string]): void;
|
|
179
|
-
/**
|
|
180
|
-
* Set `name` attribute to `value`. Override old value if exists.
|
|
181
|
-
*/
|
|
182
|
-
attrSet(name: string, value: string): void;
|
|
183
|
-
/**
|
|
184
|
-
* Get the value of attribute `name`, or null if it does not exist.
|
|
185
|
-
*/
|
|
186
|
-
attrGet(name: string): string | null;
|
|
187
|
-
/**
|
|
188
|
-
* Join value to existing attribute via space. Or create new attribute if not
|
|
189
|
-
* exists. Useful to operate with token classes.
|
|
190
|
-
*/
|
|
191
|
-
attrJoin(name: string, value: string): void;
|
|
192
|
-
}
|
|
193
|
-
//#endregion
|
|
194
|
-
//#region node_modules/.pnpm/@types+markdown-it@14.2.0/node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.mts
|
|
195
|
-
interface Scanned {
|
|
196
|
-
can_open: boolean;
|
|
197
|
-
can_close: boolean;
|
|
198
|
-
length: number;
|
|
199
|
-
}
|
|
200
|
-
interface Delimiter {
|
|
201
|
-
marker: number;
|
|
202
|
-
length: number;
|
|
203
|
-
token: number;
|
|
204
|
-
end: number;
|
|
205
|
-
open: boolean;
|
|
206
|
-
close: boolean;
|
|
207
|
-
}
|
|
208
|
-
interface TokenMeta {
|
|
209
|
-
delimiters: Delimiter[];
|
|
210
|
-
}
|
|
211
|
-
declare class StateInline {
|
|
212
|
-
constructor(src: string, md: MarkdownIt, env: any, outTokens: Token[]);
|
|
213
|
-
src: string;
|
|
214
|
-
env: any;
|
|
215
|
-
md: MarkdownIt;
|
|
216
|
-
tokens: Token[];
|
|
217
|
-
tokens_meta: Array<TokenMeta | null>;
|
|
218
|
-
pos: number;
|
|
219
|
-
posMax: number;
|
|
220
|
-
level: number;
|
|
221
|
-
pending: string;
|
|
222
|
-
pendingLevel: number;
|
|
223
|
-
/**
|
|
224
|
-
* Stores { start: end } pairs. Useful for backtrack
|
|
225
|
-
* optimization of pairs parse (emphasis, strikes).
|
|
226
|
-
*/
|
|
227
|
-
cache: any;
|
|
228
|
-
/**
|
|
229
|
-
* List of emphasis-like delimiters for current tag
|
|
230
|
-
*/
|
|
231
|
-
delimiters: Delimiter[]; // Stack of delimiter lists for upper level tags
|
|
232
|
-
// _prev_delimiters: StateInline.Delimiter[][];
|
|
233
|
-
/**
|
|
234
|
-
* Flush pending text
|
|
235
|
-
*/
|
|
236
|
-
pushPending(): Token;
|
|
237
|
-
/**
|
|
238
|
-
* Push new token to "stream".
|
|
239
|
-
* If pending text exists - flush it as text token
|
|
240
|
-
*/
|
|
241
|
-
push(type: string, tag: string, nesting: Nesting): Token;
|
|
242
|
-
/**
|
|
243
|
-
* Scan a sequence of emphasis-like markers, and determine whether
|
|
244
|
-
* it can start an emphasis sequence or end an emphasis sequence.
|
|
245
|
-
*
|
|
246
|
-
* @param start position to scan from (it should point at a valid marker)
|
|
247
|
-
* @param canSplitWord determine if these markers can be found inside a word
|
|
248
|
-
*/
|
|
249
|
-
scanDelims(start: number, canSplitWord: boolean): Scanned;
|
|
250
|
-
Token: typeof Token;
|
|
251
|
-
}
|
|
252
|
-
//#endregion
|
|
253
|
-
//#region node_modules/.pnpm/@types+markdown-it@14.2.0/node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.mts
|
|
254
|
-
declare function parseLinkLabel(state: StateInline, start: number, disableNested?: boolean): number;
|
|
255
|
-
//#endregion
|
|
256
|
-
//#region node_modules/.pnpm/@types+markdown-it@14.2.0/node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.mts
|
|
257
|
-
interface ParseLinkTitleResult {
|
|
258
|
-
/**
|
|
259
|
-
* if `true`, this is a valid link title
|
|
260
|
-
*/
|
|
261
|
-
ok: boolean;
|
|
262
|
-
/**
|
|
263
|
-
* if `true`, this link can be continued on the next line
|
|
264
|
-
*/
|
|
265
|
-
can_continue: boolean;
|
|
266
|
-
/**
|
|
267
|
-
* if `ok`, it's the position of the first character after the closing marker
|
|
268
|
-
*/
|
|
269
|
-
pos: number;
|
|
270
|
-
/**
|
|
271
|
-
* if `ok`, it's the unescaped title
|
|
272
|
-
*/
|
|
273
|
-
str: string;
|
|
274
|
-
/**
|
|
275
|
-
* expected closing marker character code
|
|
276
|
-
*/
|
|
277
|
-
marker: number;
|
|
278
|
-
}
|
|
279
|
-
declare function parseLinkTitle(str: string, start: number, max: number, prev_state?: ParseLinkTitleResult): ParseLinkTitleResult;
|
|
280
|
-
declare namespace index_d_exports {
|
|
281
|
-
export { parseLinkDestination, parseLinkLabel, parseLinkTitle };
|
|
282
|
-
}
|
|
283
|
-
//#endregion
|
|
284
|
-
//#region node_modules/.pnpm/@types+markdown-it@14.2.0/node_modules/@types/markdown-it/lib/ruler.d.mts
|
|
285
|
-
interface RuleOptions {
|
|
286
|
-
/**
|
|
287
|
-
* array with names of "alternate" chains.
|
|
288
|
-
*/
|
|
289
|
-
alt: string[];
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Helper class, used by {@link MarkdownIt#core}, {@link MarkdownIt#block} and
|
|
293
|
-
* {@link MarkdownIt#inline} to manage sequences of functions (rules):
|
|
294
|
-
*
|
|
295
|
-
* - keep rules in defined order
|
|
296
|
-
* - assign the name to each rule
|
|
297
|
-
* - enable/disable rules
|
|
298
|
-
* - add/replace rules
|
|
299
|
-
* - allow assign rules to additional named chains (in the same)
|
|
300
|
-
* - caching lists of active rules
|
|
301
|
-
*
|
|
302
|
-
* You will not need use this class directly until write plugins. For simple
|
|
303
|
-
* rules control use {@link MarkdownIt.disable}, {@link MarkdownIt.enable} and
|
|
304
|
-
* {@link MarkdownIt.use}.
|
|
305
|
-
*/
|
|
306
|
-
declare class Ruler<T> {
|
|
307
|
-
constructor();
|
|
308
|
-
/**
|
|
309
|
-
* Replace rule by name with new function & options. Throws error if name not
|
|
310
|
-
* found.
|
|
311
|
-
*
|
|
312
|
-
* ##### Example
|
|
313
|
-
*
|
|
314
|
-
* Replace existing typographer replacement rule with new one:
|
|
315
|
-
*
|
|
316
|
-
* ```javascript
|
|
317
|
-
* var md = require('markdown-it')();
|
|
318
|
-
*
|
|
319
|
-
* md.core.ruler.at('replacements', function replace(state) {
|
|
320
|
-
* //...
|
|
321
|
-
* });
|
|
322
|
-
* ```
|
|
323
|
-
*
|
|
324
|
-
* @param name rule name to replace.
|
|
325
|
-
* @param fn new rule function.
|
|
326
|
-
* @param options new rule options (not mandatory).
|
|
327
|
-
*/
|
|
328
|
-
at(name: string, fn: T, options?: RuleOptions): void;
|
|
329
|
-
/**
|
|
330
|
-
* Add new rule to chain before one with given name.
|
|
331
|
-
*
|
|
332
|
-
* ##### Example
|
|
333
|
-
*
|
|
334
|
-
* ```javascript
|
|
335
|
-
* var md = require('markdown-it')();
|
|
336
|
-
*
|
|
337
|
-
* md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
|
|
338
|
-
* //...
|
|
339
|
-
* });
|
|
340
|
-
* ```
|
|
341
|
-
*
|
|
342
|
-
* @see {@link Ruler.after}, {@link Ruler.push}
|
|
343
|
-
*
|
|
344
|
-
* @param beforeName new rule will be added before this one.
|
|
345
|
-
* @param ruleName name of added rule.
|
|
346
|
-
* @param fn rule function.
|
|
347
|
-
* @param options rule options (not mandatory).
|
|
348
|
-
*/
|
|
349
|
-
before(beforeName: string, ruleName: string, fn: T, options?: RuleOptions): void;
|
|
350
|
-
/**
|
|
351
|
-
* Add new rule to chain after one with given name.
|
|
352
|
-
*
|
|
353
|
-
* ##### Example
|
|
354
|
-
*
|
|
355
|
-
* ```javascript
|
|
356
|
-
* var md = require('markdown-it')();
|
|
357
|
-
*
|
|
358
|
-
* md.inline.ruler.after('text', 'my_rule', function replace(state) {
|
|
359
|
-
* //...
|
|
360
|
-
* });
|
|
361
|
-
* ```
|
|
362
|
-
*
|
|
363
|
-
* @see {@link Ruler.before}, {@link Ruler.push}
|
|
364
|
-
*
|
|
365
|
-
* @param afterName new rule will be added after this one.
|
|
366
|
-
* @param ruleName name of added rule.
|
|
367
|
-
* @param fn rule function.
|
|
368
|
-
* @param options rule options (not mandatory).
|
|
369
|
-
*/
|
|
370
|
-
after(afterName: string, ruleName: string, fn: T, options?: RuleOptions): void;
|
|
371
|
-
/**
|
|
372
|
-
* Push new rule to the end of chain.
|
|
373
|
-
*
|
|
374
|
-
* ##### Example
|
|
375
|
-
*
|
|
376
|
-
* ```javascript
|
|
377
|
-
* var md = require('markdown-it')();
|
|
378
|
-
*
|
|
379
|
-
* md.core.ruler.push('my_rule', function replace(state) {
|
|
380
|
-
* //...
|
|
381
|
-
* });
|
|
382
|
-
* ```
|
|
383
|
-
*
|
|
384
|
-
* @see {@link Ruler.before}, {@link Ruler.after}
|
|
385
|
-
*
|
|
386
|
-
* @param ruleName name of added rule.
|
|
387
|
-
* @param fn rule function.
|
|
388
|
-
* @param options rule options (not mandatory).
|
|
389
|
-
*/
|
|
390
|
-
push(ruleName: string, fn: T, options?: RuleOptions): void;
|
|
391
|
-
/**
|
|
392
|
-
* Enable rules with given names. If any rule name not found - throw Error.
|
|
393
|
-
* Errors can be disabled by second param.
|
|
394
|
-
*
|
|
395
|
-
* Returns list of found rule names (if no exception happened).
|
|
396
|
-
*
|
|
397
|
-
* @see {@link Ruler.disable}, {@link Ruler.enableOnly}
|
|
398
|
-
*
|
|
399
|
-
* @param list list of rule names to enable.
|
|
400
|
-
* @param ignoreInvalid set `true` to ignore errors when rule not found.
|
|
401
|
-
*/
|
|
402
|
-
enable(list: string | string[], ignoreInvalid?: boolean): string[];
|
|
403
|
-
/**
|
|
404
|
-
* Enable rules with given names, and disable everything else. If any rule name
|
|
405
|
-
* not found - throw Error. Errors can be disabled by second param.
|
|
406
|
-
*
|
|
407
|
-
* @see {@link Ruler.disable}, {@link Ruler.enable}
|
|
408
|
-
*
|
|
409
|
-
* @param list list of rule names to enable (whitelist).
|
|
410
|
-
* @param ignoreInvalid set `true` to ignore errors when rule not found.
|
|
411
|
-
*/
|
|
412
|
-
enableOnly(list: string | string[], ignoreInvalid?: boolean): void;
|
|
413
|
-
/**
|
|
414
|
-
* Disable rules with given names. If any rule name not found - throw Error.
|
|
415
|
-
* Errors can be disabled by second param.
|
|
416
|
-
*
|
|
417
|
-
* Returns list of found rule names (if no exception happened).
|
|
418
|
-
*
|
|
419
|
-
* @see {@link Ruler.enable}, {@link Ruler.enableOnly}
|
|
420
|
-
*
|
|
421
|
-
* @param list list of rule names to disable.
|
|
422
|
-
* @param ignoreInvalid set `true` to ignore errors when rule not found.
|
|
423
|
-
*/
|
|
424
|
-
disable(list: string | string[], ignoreInvalid?: boolean): string[];
|
|
425
|
-
/**
|
|
426
|
-
* Return array of active functions (rules) for given chain name. It analyzes
|
|
427
|
-
* rules configuration, compiles caches if not exists and returns result.
|
|
428
|
-
*
|
|
429
|
-
* Default chain name is `''` (empty string). It can't be skipped. That's
|
|
430
|
-
* done intentionally, to keep signature monomorphic for high speed.
|
|
431
|
-
*/
|
|
432
|
-
getRules(chainName: string): T[];
|
|
433
|
-
}
|
|
434
|
-
//#endregion
|
|
435
|
-
//#region node_modules/.pnpm/@types+markdown-it@14.2.0/node_modules/@types/markdown-it/lib/rules_block/state_block.d.mts
|
|
436
|
-
type ParentType = "blockquote" | "list" | "root" | "paragraph" | "reference";
|
|
437
|
-
declare class StateBlock {
|
|
438
|
-
constructor(src: string, md: MarkdownIt, env: any, tokens: Token[]);
|
|
439
|
-
src: string;
|
|
440
|
-
/**
|
|
441
|
-
* link to parser instance
|
|
442
|
-
*/
|
|
443
|
-
md: MarkdownIt;
|
|
444
|
-
env: any; //
|
|
445
|
-
// Internal state vartiables
|
|
446
|
-
//
|
|
447
|
-
tokens: Token[];
|
|
448
|
-
/**
|
|
449
|
-
* line begin offsets for fast jumps
|
|
450
|
-
*/
|
|
451
|
-
bMarks: number[];
|
|
452
|
-
/**
|
|
453
|
-
* line end offsets for fast jumps
|
|
454
|
-
*/
|
|
455
|
-
eMarks: number[];
|
|
456
|
-
/**
|
|
457
|
-
* offsets of the first non-space characters (tabs not expanded)
|
|
458
|
-
*/
|
|
459
|
-
tShift: number[];
|
|
460
|
-
/**
|
|
461
|
-
* indents for each line (tabs expanded)
|
|
462
|
-
*/
|
|
463
|
-
sCount: number[];
|
|
464
|
-
/**
|
|
465
|
-
* An amount of virtual spaces (tabs expanded) between beginning
|
|
466
|
-
* of each line (bMarks) and real beginning of that line.
|
|
467
|
-
*
|
|
468
|
-
* It exists only as a hack because blockquotes override bMarks
|
|
469
|
-
* losing information in the process.
|
|
470
|
-
*
|
|
471
|
-
* It's used only when expanding tabs, you can think about it as
|
|
472
|
-
* an initial tab length, e.g. bsCount=21 applied to string `\t123`
|
|
473
|
-
* means first tab should be expanded to 4-21%4 === 3 spaces.
|
|
474
|
-
*/
|
|
475
|
-
bsCount: number[]; // block parser variables
|
|
476
|
-
/**
|
|
477
|
-
* required block content indent (for example, if we are
|
|
478
|
-
* inside a list, it would be positioned after list marker)
|
|
479
|
-
*/
|
|
480
|
-
blkIndent: number;
|
|
481
|
-
/**
|
|
482
|
-
* line index in src
|
|
483
|
-
*/
|
|
484
|
-
line: number;
|
|
485
|
-
/**
|
|
486
|
-
* lines count
|
|
487
|
-
*/
|
|
488
|
-
lineMax: number;
|
|
489
|
-
/**
|
|
490
|
-
* loose/tight mode for lists
|
|
491
|
-
*/
|
|
492
|
-
tight: boolean;
|
|
493
|
-
/**
|
|
494
|
-
* indent of the current dd block (-1 if there isn't any)
|
|
495
|
-
*/
|
|
496
|
-
ddIndent: number;
|
|
497
|
-
/**
|
|
498
|
-
* indent of the current list block (-1 if there isn't any)
|
|
499
|
-
*/
|
|
500
|
-
listIndent: number;
|
|
501
|
-
/**
|
|
502
|
-
* used in lists to determine if they interrupt a paragraph
|
|
503
|
-
*/
|
|
504
|
-
parentType: ParentType;
|
|
505
|
-
level: number;
|
|
506
|
-
/**
|
|
507
|
-
* Push new token to "stream".
|
|
508
|
-
*/
|
|
509
|
-
push(type: string, tag: string, nesting: Nesting): Token;
|
|
510
|
-
isEmpty(line: number): boolean;
|
|
511
|
-
skipEmptyLines(from: number): number;
|
|
512
|
-
/**
|
|
513
|
-
* Skip spaces from given position.
|
|
514
|
-
*/
|
|
515
|
-
skipSpaces(pos: number): number;
|
|
516
|
-
/**
|
|
517
|
-
* Skip spaces from given position in reverse.
|
|
518
|
-
*/
|
|
519
|
-
skipSpacesBack(pos: number, min: number): number;
|
|
520
|
-
/**
|
|
521
|
-
* Skip char codes from given position
|
|
522
|
-
*/
|
|
523
|
-
skipChars(pos: number, code: number): number;
|
|
524
|
-
/**
|
|
525
|
-
* Skip char codes reverse from given position - 1
|
|
526
|
-
*/
|
|
527
|
-
skipCharsBack(pos: number, code: number, min: number): number;
|
|
528
|
-
/**
|
|
529
|
-
* cut lines range from source.
|
|
530
|
-
*/
|
|
531
|
-
getLines(begin: number, end: number, indent: number, keepLastLF: boolean): string;
|
|
532
|
-
Token: typeof Token;
|
|
533
|
-
}
|
|
534
|
-
//#endregion
|
|
535
|
-
//#region node_modules/.pnpm/@types+markdown-it@14.2.0/node_modules/@types/markdown-it/lib/parser_block.d.mts
|
|
536
|
-
type RuleBlock = (state: StateBlock, startLine: number, endLine: number, silent: boolean) => boolean;
|
|
537
|
-
declare class ParserBlock {
|
|
538
|
-
/**
|
|
539
|
-
* {@link Ruler} instance. Keep configuration of block rules.
|
|
540
|
-
*/
|
|
541
|
-
ruler: Ruler<RuleBlock>;
|
|
542
|
-
/**
|
|
543
|
-
* Generate tokens for input range
|
|
544
|
-
*/
|
|
545
|
-
tokenize(state: StateBlock, startLine: number, endLine: number): void;
|
|
546
|
-
/**
|
|
547
|
-
* Process input string and push block tokens into `outTokens`
|
|
548
|
-
*/
|
|
549
|
-
parse(str: string, md: MarkdownIt, env: any, outTokens: Token[]): void;
|
|
550
|
-
State: typeof StateBlock;
|
|
551
|
-
}
|
|
552
|
-
//#endregion
|
|
553
|
-
//#region node_modules/.pnpm/@types+markdown-it@14.2.0/node_modules/@types/markdown-it/lib/rules_core/state_core.d.mts
|
|
554
|
-
declare class StateCore {
|
|
555
|
-
constructor(src: string, md: MarkdownIt, env: any);
|
|
556
|
-
src: string;
|
|
557
|
-
env: any;
|
|
558
|
-
tokens: Token[];
|
|
559
|
-
inlineMode: boolean;
|
|
560
|
-
/**
|
|
561
|
-
* link to parser instance
|
|
562
|
-
*/
|
|
563
|
-
md: MarkdownIt;
|
|
564
|
-
Token: typeof Token;
|
|
565
|
-
}
|
|
566
|
-
//#endregion
|
|
567
|
-
//#region node_modules/.pnpm/@types+markdown-it@14.2.0/node_modules/@types/markdown-it/lib/parser_core.d.mts
|
|
568
|
-
type RuleCore = (state: StateCore) => void;
|
|
569
|
-
declare class Core {
|
|
570
|
-
/**
|
|
571
|
-
* {@link Ruler} instance. Keep configuration of core rules.
|
|
572
|
-
*/
|
|
573
|
-
ruler: Ruler<RuleCore>;
|
|
574
|
-
/**
|
|
575
|
-
* Executes core chain rules.
|
|
576
|
-
*/
|
|
577
|
-
process(state: StateCore): void;
|
|
578
|
-
State: typeof StateCore;
|
|
579
|
-
}
|
|
580
|
-
//#endregion
|
|
581
|
-
//#region node_modules/.pnpm/@types+markdown-it@14.2.0/node_modules/@types/markdown-it/lib/parser_inline.d.mts
|
|
582
|
-
type RuleInline = (state: StateInline, silent: boolean) => boolean;
|
|
583
|
-
type RuleInline2 = (state: StateInline) => boolean;
|
|
584
|
-
declare class ParserInline {
|
|
585
|
-
/**
|
|
586
|
-
* {@link Ruler} instance. Keep configuration of inline rules.
|
|
587
|
-
*/
|
|
588
|
-
ruler: Ruler<RuleInline>;
|
|
589
|
-
/**
|
|
590
|
-
* {@link Ruler} instance. Second ruler used for post-processing
|
|
591
|
-
* (e.g. in emphasis-like rules).
|
|
592
|
-
*/
|
|
593
|
-
ruler2: Ruler<RuleInline2>;
|
|
594
|
-
/**
|
|
595
|
-
* Skip single token by running all rules in validation mode;
|
|
596
|
-
* returns `true` if any rule reported success
|
|
597
|
-
*/
|
|
598
|
-
skipToken(state: StateInline): void;
|
|
599
|
-
/**
|
|
600
|
-
* Generate tokens for input range
|
|
601
|
-
*/
|
|
602
|
-
tokenize(state: StateInline): void;
|
|
603
|
-
/**
|
|
604
|
-
* Process input string and push inline tokens into `outTokens`
|
|
605
|
-
*/
|
|
606
|
-
parse(str: string, md: MarkdownIt, env: any, outTokens: Token[]): void;
|
|
607
|
-
State: typeof StateInline;
|
|
608
|
-
}
|
|
609
|
-
//#endregion
|
|
610
|
-
//#region node_modules/.pnpm/@types+markdown-it@14.2.0/node_modules/@types/markdown-it/lib/renderer.d.mts
|
|
611
|
-
type RenderRule = (tokens: Token[], idx: number, options: Options, env: any, self: Renderer) => string;
|
|
612
|
-
interface RenderRuleRecord {
|
|
613
|
-
[type: string]: RenderRule | undefined;
|
|
614
|
-
code_inline?: RenderRule | undefined;
|
|
615
|
-
code_block?: RenderRule | undefined;
|
|
616
|
-
fence?: RenderRule | undefined;
|
|
617
|
-
image?: RenderRule | undefined;
|
|
618
|
-
hardbreak?: RenderRule | undefined;
|
|
619
|
-
softbreak?: RenderRule | undefined;
|
|
620
|
-
text?: RenderRule | undefined;
|
|
621
|
-
html_block?: RenderRule | undefined;
|
|
622
|
-
html_inline?: RenderRule | undefined;
|
|
623
|
-
}
|
|
624
|
-
declare class Renderer {
|
|
625
|
-
/**
|
|
626
|
-
* Creates new {@link Renderer} instance and fill {@link Renderer#rules} with defaults.
|
|
627
|
-
*/
|
|
628
|
-
constructor();
|
|
629
|
-
/**
|
|
630
|
-
* Contains render rules for tokens. Can be updated and extended.
|
|
631
|
-
*
|
|
632
|
-
* ##### Example
|
|
633
|
-
*
|
|
634
|
-
* ```javascript
|
|
635
|
-
* var md = require('markdown-it')();
|
|
636
|
-
*
|
|
637
|
-
* md.renderer.rules.strong_open = function () { return '<b>'; };
|
|
638
|
-
* md.renderer.rules.strong_close = function () { return '</b>'; };
|
|
639
|
-
*
|
|
640
|
-
* var result = md.renderInline(...);
|
|
641
|
-
* ```
|
|
642
|
-
*
|
|
643
|
-
* Each rule is called as independent static function with fixed signature:
|
|
644
|
-
*
|
|
645
|
-
* ```javascript
|
|
646
|
-
* function my_token_render(tokens, idx, options, env, renderer) {
|
|
647
|
-
* // ...
|
|
648
|
-
* return renderedHTML;
|
|
649
|
-
* }
|
|
650
|
-
* ```
|
|
651
|
-
*
|
|
652
|
-
* @see https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs
|
|
653
|
-
*/
|
|
654
|
-
rules: RenderRuleRecord;
|
|
655
|
-
/**
|
|
656
|
-
* Render token attributes to string.
|
|
657
|
-
*/
|
|
658
|
-
renderAttrs(token: Token): string;
|
|
659
|
-
/**
|
|
660
|
-
* Default token renderer. Can be overriden by custom function
|
|
661
|
-
* in {@link Renderer#rules}.
|
|
662
|
-
*
|
|
663
|
-
* @param tokens list of tokens
|
|
664
|
-
* @param idx token index to render
|
|
665
|
-
* @param options params of parser instance
|
|
666
|
-
*/
|
|
667
|
-
renderToken(tokens: Token[], idx: number, options: Options): string;
|
|
668
|
-
/**
|
|
669
|
-
* The same as {@link Renderer.render}, but for single token of `inline` type.
|
|
670
|
-
*
|
|
671
|
-
* @param tokens list of block tokens to render
|
|
672
|
-
* @param options params of parser instance
|
|
673
|
-
* @param env additional data from parsed input (references, for example)
|
|
674
|
-
*/
|
|
675
|
-
renderInline(tokens: Token[], options: Options, env: any): string;
|
|
676
|
-
/**
|
|
677
|
-
* Special kludge for image `alt` attributes to conform CommonMark spec.
|
|
678
|
-
* Don't try to use it! Spec requires to show `alt` content with stripped markup,
|
|
679
|
-
* instead of simple escaping.
|
|
680
|
-
*
|
|
681
|
-
* @param tokens list of block tokens to render
|
|
682
|
-
* @param options params of parser instance
|
|
683
|
-
* @param env additional data from parsed input (references, for example)
|
|
684
|
-
*/
|
|
685
|
-
renderInlineAsText(tokens: Token[], options: Options, env: any): string;
|
|
686
|
-
/**
|
|
687
|
-
* Takes token stream and generates HTML. Probably, you will never need to call
|
|
688
|
-
* this method directly.
|
|
689
|
-
*
|
|
690
|
-
* @param tokens list of block tokens to render
|
|
691
|
-
* @param options params of parser instance
|
|
692
|
-
* @param env additional data from parsed input (references, for example)
|
|
693
|
-
*/
|
|
694
|
-
render(tokens: Token[], options: Options, env: any): string;
|
|
695
|
-
}
|
|
696
|
-
//#endregion
|
|
697
|
-
//#region node_modules/.pnpm/@types+markdown-it@14.2.0/node_modules/@types/markdown-it/lib/index.d.mts
|
|
698
|
-
/**
|
|
699
|
-
* MarkdownIt provides named presets as a convenience to quickly
|
|
700
|
-
* enable/disable active syntax rules and options for common use cases.
|
|
701
|
-
*
|
|
702
|
-
* - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) -
|
|
703
|
-
* configures parser to strict [CommonMark](http://commonmark.org/) mode.
|
|
704
|
-
* - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) -
|
|
705
|
-
* similar to GFM, used when no preset name given. Enables all available rules,
|
|
706
|
-
* but still without html, typographer & autolinker.
|
|
707
|
-
* - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) -
|
|
708
|
-
* all rules disabled. Useful to quickly setup your config via `.enable()`.
|
|
709
|
-
* For example, when you need only `bold` and `italic` markup and nothing else.
|
|
710
|
-
*/
|
|
711
|
-
type PresetName = "default" | "zero" | "commonmark";
|
|
712
|
-
interface Options {
|
|
713
|
-
/**
|
|
714
|
-
* Set `true` to enable HTML tags in source. Be careful!
|
|
715
|
-
* That's not safe! You may need external sanitizer to protect output from XSS.
|
|
716
|
-
* It's better to extend features via plugins, instead of enabling HTML.
|
|
717
|
-
* @default false
|
|
718
|
-
*/
|
|
719
|
-
html?: boolean | undefined;
|
|
720
|
-
/**
|
|
721
|
-
* Set `true` to add '/' when closing single tags
|
|
722
|
-
* (`<br />`). This is needed only for full CommonMark compatibility. In real
|
|
723
|
-
* world you will need HTML output.
|
|
724
|
-
* @default false
|
|
725
|
-
*/
|
|
726
|
-
xhtmlOut?: boolean | undefined;
|
|
727
|
-
/**
|
|
728
|
-
* Set `true` to convert `\n` in paragraphs into `<br>`.
|
|
729
|
-
* @default false
|
|
730
|
-
*/
|
|
731
|
-
breaks?: boolean | undefined;
|
|
732
|
-
/**
|
|
733
|
-
* CSS language class prefix for fenced blocks.
|
|
734
|
-
* Can be useful for external highlighters.
|
|
735
|
-
* @default 'language-'
|
|
736
|
-
*/
|
|
737
|
-
langPrefix?: string | undefined;
|
|
738
|
-
/**
|
|
739
|
-
* Set `true` to autoconvert URL-like text to links.
|
|
740
|
-
* @default false
|
|
741
|
-
*/
|
|
742
|
-
linkify?: boolean | undefined;
|
|
743
|
-
/**
|
|
744
|
-
* Set `true` to enable [some language-neutral replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) +
|
|
745
|
-
* quotes beautification (smartquotes).
|
|
746
|
-
* @default false
|
|
747
|
-
*/
|
|
748
|
-
typographer?: boolean | undefined;
|
|
749
|
-
/**
|
|
750
|
-
* Double + single quotes replacement
|
|
751
|
-
* pairs, when typographer enabled and smartquotes on. For example, you can
|
|
752
|
-
* use `'«»„“'` for Russian, `'„“‚‘'` for German, and
|
|
753
|
-
* `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp).
|
|
754
|
-
* @default '“”‘’'
|
|
755
|
-
*/
|
|
756
|
-
quotes?: string | string[];
|
|
757
|
-
/**
|
|
758
|
-
* Highlighter function for fenced code blocks.
|
|
759
|
-
* Highlighter `function (str, lang, attrs)` should return escaped HTML. It can
|
|
760
|
-
* also return empty string if the source was not changed and should be escaped
|
|
761
|
-
* externally. If result starts with <pre... internal wrapper is skipped.
|
|
762
|
-
* @default null
|
|
763
|
-
*/
|
|
764
|
-
highlight?: ((str: string, lang: string, attrs: string) => string) | null | undefined;
|
|
765
|
-
}
|
|
766
|
-
type PluginSimple = (md: MarkdownIt) => void;
|
|
767
|
-
type PluginWithOptions<T = any> = (md: MarkdownIt, options?: T) => void;
|
|
768
|
-
type PluginWithParams = (md: MarkdownIt, ...params: any[]) => void;
|
|
769
|
-
interface MarkdownItConstructor {
|
|
770
|
-
new (): MarkdownIt;
|
|
771
|
-
new (presetName: PresetName, options?: Options): MarkdownIt;
|
|
772
|
-
new (options: Options): MarkdownIt;
|
|
773
|
-
(): MarkdownIt;
|
|
774
|
-
(presetName: PresetName, options?: Options): MarkdownIt;
|
|
775
|
-
(options: Options): MarkdownIt;
|
|
776
|
-
}
|
|
777
|
-
interface MarkdownIt {
|
|
778
|
-
/**
|
|
779
|
-
* Instance of {@link ParserInline}. You may need it to add new rules when
|
|
780
|
-
* writing plugins. For simple rules control use {@link MarkdownIt.disable} and
|
|
781
|
-
* {@link MarkdownIt.enable}.
|
|
782
|
-
*/
|
|
783
|
-
readonly inline: ParserInline;
|
|
784
|
-
/**
|
|
785
|
-
* Instance of {@link ParserBlock}. You may need it to add new rules when
|
|
786
|
-
* writing plugins. For simple rules control use {@link MarkdownIt.disable} and
|
|
787
|
-
* {@link MarkdownIt.enable}.
|
|
788
|
-
*/
|
|
789
|
-
readonly block: ParserBlock;
|
|
790
|
-
/**
|
|
791
|
-
* Instance of {@link Core} chain executor. You may need it to add new rules when
|
|
792
|
-
* writing plugins. For simple rules control use {@link MarkdownIt.disable} and
|
|
793
|
-
* {@link MarkdownIt.enable}.
|
|
794
|
-
*/
|
|
795
|
-
readonly core: Core;
|
|
796
|
-
/**
|
|
797
|
-
* Instance of {@link Renderer}. Use it to modify output look. Or to add rendering
|
|
798
|
-
* rules for new token types, generated by plugins.
|
|
799
|
-
*
|
|
800
|
-
* ##### Example
|
|
801
|
-
*
|
|
802
|
-
* ```javascript
|
|
803
|
-
* var md = require('markdown-it')();
|
|
804
|
-
*
|
|
805
|
-
* function myToken(tokens, idx, options, env, self) {
|
|
806
|
-
* //...
|
|
807
|
-
* return result;
|
|
808
|
-
* };
|
|
809
|
-
*
|
|
810
|
-
* md.renderer.rules['my_token'] = myToken
|
|
811
|
-
* ```
|
|
812
|
-
*
|
|
813
|
-
* See {@link Renderer} docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
|
|
814
|
-
*/
|
|
815
|
-
readonly renderer: Renderer;
|
|
816
|
-
/**
|
|
817
|
-
* [linkify-it](https://github.com/markdown-it/linkify-it) instance.
|
|
818
|
-
* Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js)
|
|
819
|
-
* rule.
|
|
820
|
-
*/
|
|
821
|
-
readonly linkify: LinkifyIt;
|
|
822
|
-
/**
|
|
823
|
-
* Link validation function. CommonMark allows too much in links. By default
|
|
824
|
-
* we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
|
|
825
|
-
* except some embedded image types.
|
|
826
|
-
*
|
|
827
|
-
* You can change this behaviour:
|
|
828
|
-
*
|
|
829
|
-
* ```javascript
|
|
830
|
-
* var md = require('markdown-it')();
|
|
831
|
-
* // enable everything
|
|
832
|
-
* md.validateLink = function () { return true; }
|
|
833
|
-
* ```
|
|
834
|
-
*/
|
|
835
|
-
validateLink(url: string): boolean;
|
|
836
|
-
/**
|
|
837
|
-
* Function used to encode link url to a machine-readable format,
|
|
838
|
-
* which includes url-encoding, punycode, etc.
|
|
839
|
-
*/
|
|
840
|
-
normalizeLink(url: string): string;
|
|
841
|
-
/**
|
|
842
|
-
* Function used to decode link url to a human-readable format`
|
|
843
|
-
*/
|
|
844
|
-
normalizeLinkText(url: string): string;
|
|
845
|
-
readonly utils: typeof utils_d_exports;
|
|
846
|
-
readonly helpers: typeof index_d_exports;
|
|
847
|
-
readonly options: Options;
|
|
848
|
-
/**
|
|
849
|
-
* *chainable*
|
|
850
|
-
*
|
|
851
|
-
* Set parser options (in the same format as in constructor). Probably, you
|
|
852
|
-
* will never need it, but you can change options after constructor call.
|
|
853
|
-
*
|
|
854
|
-
* ##### Example
|
|
855
|
-
*
|
|
856
|
-
* ```javascript
|
|
857
|
-
* var md = require('markdown-it')()
|
|
858
|
-
* .set({ html: true, breaks: true })
|
|
859
|
-
* .set({ typographer: true });
|
|
860
|
-
* ```
|
|
861
|
-
*
|
|
862
|
-
* __Note:__ To achieve the best possible performance, don't modify a
|
|
863
|
-
* `markdown-it` instance options on the fly. If you need multiple configurations
|
|
864
|
-
* it's best to create multiple instances and initialize each with separate
|
|
865
|
-
* config.
|
|
866
|
-
*/
|
|
867
|
-
set(options: Options): this;
|
|
868
|
-
/**
|
|
869
|
-
* *chainable*, *internal*
|
|
870
|
-
*
|
|
871
|
-
* Batch load of all options and compenent settings. This is internal method,
|
|
872
|
-
* and you probably will not need it. But if you with - see available presets
|
|
873
|
-
* and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)
|
|
874
|
-
*
|
|
875
|
-
* We strongly recommend to use presets instead of direct config loads. That
|
|
876
|
-
* will give better compatibility with next versions.
|
|
877
|
-
*/
|
|
878
|
-
configure(presets: PresetName): this;
|
|
879
|
-
/**
|
|
880
|
-
* *chainable*
|
|
881
|
-
*
|
|
882
|
-
* Enable list or rules. It will automatically find appropriate components,
|
|
883
|
-
* containing rules with given names. If rule not found, and `ignoreInvalid`
|
|
884
|
-
* not set - throws exception.
|
|
885
|
-
*
|
|
886
|
-
* ##### Example
|
|
887
|
-
*
|
|
888
|
-
* ```javascript
|
|
889
|
-
* var md = require('markdown-it')()
|
|
890
|
-
* .enable(['sub', 'sup'])
|
|
891
|
-
* .disable('smartquotes');
|
|
892
|
-
* ```
|
|
893
|
-
*
|
|
894
|
-
* @param list rule name or list of rule names to enable
|
|
895
|
-
* @param ignoreInvalid set `true` to ignore errors when rule not found.
|
|
896
|
-
*/
|
|
897
|
-
enable(list: string | string[], ignoreInvalid?: boolean): this;
|
|
898
|
-
/**
|
|
899
|
-
* *chainable*
|
|
900
|
-
*
|
|
901
|
-
* The same as {@link MarkdownIt.enable}, but turn specified rules off.
|
|
902
|
-
*
|
|
903
|
-
* @param list rule name or list of rule names to disable.
|
|
904
|
-
* @param ignoreInvalid set `true` to ignore errors when rule not found.
|
|
905
|
-
*/
|
|
906
|
-
disable(list: string | string[], ignoreInvalid?: boolean): this;
|
|
907
|
-
/**
|
|
908
|
-
* *chainable*
|
|
909
|
-
*
|
|
910
|
-
* Load specified plugin with given params into current parser instance.
|
|
911
|
-
* It's just a sugar to call `plugin(md, params)` with curring.
|
|
912
|
-
*
|
|
913
|
-
* ##### Example
|
|
914
|
-
*
|
|
915
|
-
* ```javascript
|
|
916
|
-
* var iterator = require('markdown-it-for-inline');
|
|
917
|
-
* var md = require('markdown-it')()
|
|
918
|
-
* .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
|
|
919
|
-
* tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');
|
|
920
|
-
* });
|
|
921
|
-
* ```
|
|
922
|
-
*/
|
|
923
|
-
use(plugin: PluginSimple): this;
|
|
924
|
-
use<T = any>(plugin: PluginWithOptions<T>, options?: T): this;
|
|
925
|
-
use(plugin: PluginWithParams, ...params: any[]): this;
|
|
926
|
-
/**
|
|
927
|
-
* *internal*
|
|
928
|
-
*
|
|
929
|
-
* Parse input string and returns list of block tokens (special token type
|
|
930
|
-
* "inline" will contain list of inline tokens). You should not call this
|
|
931
|
-
* method directly, until you write custom renderer (for example, to produce
|
|
932
|
-
* AST).
|
|
933
|
-
*
|
|
934
|
-
* `env` is used to pass data between "distributed" rules and return additional
|
|
935
|
-
* metadata like reference info, needed for the renderer. It also can be used to
|
|
936
|
-
* inject data in specific cases. Usually, you will be ok to pass `{}`,
|
|
937
|
-
* and then pass updated object to renderer.
|
|
938
|
-
*
|
|
939
|
-
* @param src source string
|
|
940
|
-
* @param env environment sandbox
|
|
941
|
-
*/
|
|
942
|
-
parse(src: string, env: any): Token[];
|
|
943
|
-
/**
|
|
944
|
-
* Render markdown string into html. It does all magic for you :).
|
|
945
|
-
*
|
|
946
|
-
* `env` can be used to inject additional metadata (`{}` by default).
|
|
947
|
-
* But you will not need it with high probability. See also comment
|
|
948
|
-
* in {@link MarkdownIt.parse}.
|
|
949
|
-
*
|
|
950
|
-
* @param src source string
|
|
951
|
-
* @param env environment sandbox
|
|
952
|
-
*/
|
|
953
|
-
render(src: string, env?: any): string;
|
|
954
|
-
/**
|
|
955
|
-
* *internal*
|
|
956
|
-
*
|
|
957
|
-
* The same as {@link MarkdownIt.parse} but skip all block rules. It returns the
|
|
958
|
-
* block tokens list with the single `inline` element, containing parsed inline
|
|
959
|
-
* tokens in `children` property. Also updates `env` object.
|
|
960
|
-
*
|
|
961
|
-
* @param src source string
|
|
962
|
-
* @param env environment sandbox
|
|
963
|
-
*/
|
|
964
|
-
parseInline(src: string, env: any): Token[];
|
|
965
|
-
/**
|
|
966
|
-
* Similar to {@link MarkdownIt.render} but for single paragraph content. Result
|
|
967
|
-
* will NOT be wrapped into `<p>` tags.
|
|
968
|
-
*
|
|
969
|
-
* @param src source string
|
|
970
|
-
* @param env environment sandbox
|
|
971
|
-
*/
|
|
972
|
-
renderInline(src: string, env?: any): string;
|
|
973
|
-
}
|
|
974
|
-
/**
|
|
975
|
-
* Main parser/renderer class.
|
|
976
|
-
*
|
|
977
|
-
* ##### Usage
|
|
978
|
-
*
|
|
979
|
-
* ```javascript
|
|
980
|
-
* // node.js, "classic" way:
|
|
981
|
-
* var MarkdownIt = require('markdown-it'),
|
|
982
|
-
* md = new MarkdownIt();
|
|
983
|
-
* var result = md.render('# markdown-it rulezz!');
|
|
984
|
-
*
|
|
985
|
-
* // node.js, the same, but with sugar:
|
|
986
|
-
* var md = require('markdown-it')();
|
|
987
|
-
* var result = md.render('# markdown-it rulezz!');
|
|
988
|
-
*
|
|
989
|
-
* // browser without AMD, added to "window" on script load
|
|
990
|
-
* // Note, there are no dash.
|
|
991
|
-
* var md = window.markdownit();
|
|
992
|
-
* var result = md.render('# markdown-it rulezz!');
|
|
993
|
-
* ```
|
|
994
|
-
*
|
|
995
|
-
* Single line rendering, without paragraph wrap:
|
|
996
|
-
*
|
|
997
|
-
* ```javascript
|
|
998
|
-
* var md = require('markdown-it')();
|
|
999
|
-
* var result = md.renderInline('__markdown-it__ rulezz!');
|
|
1000
|
-
* ```
|
|
1001
|
-
*
|
|
1002
|
-
* ##### Example
|
|
1003
|
-
*
|
|
1004
|
-
* ```javascript
|
|
1005
|
-
* // commonmark mode
|
|
1006
|
-
* var md = require('markdown-it')('commonmark');
|
|
1007
|
-
*
|
|
1008
|
-
* // default mode
|
|
1009
|
-
* var md = require('markdown-it')();
|
|
1010
|
-
*
|
|
1011
|
-
* // enable everything
|
|
1012
|
-
* var md = require('markdown-it')({
|
|
1013
|
-
* html: true,
|
|
1014
|
-
* linkify: true,
|
|
1015
|
-
* typographer: true
|
|
1016
|
-
* });
|
|
1017
|
-
* ```
|
|
1018
|
-
*
|
|
1019
|
-
* ##### Syntax highlighting
|
|
1020
|
-
*
|
|
1021
|
-
* ```js
|
|
1022
|
-
* var hljs = require('highlight.js') // https://highlightjs.org/
|
|
1023
|
-
*
|
|
1024
|
-
* var md = require('markdown-it')({
|
|
1025
|
-
* highlight: function (str, lang) {
|
|
1026
|
-
* if (lang && hljs.getLanguage(lang)) {
|
|
1027
|
-
* try {
|
|
1028
|
-
* return hljs.highlight(lang, str, true).value;
|
|
1029
|
-
* } catch (__) {}
|
|
1030
|
-
* }
|
|
1031
|
-
*
|
|
1032
|
-
* return ''; // use external default escaping
|
|
1033
|
-
* }
|
|
1034
|
-
* });
|
|
1035
|
-
* ```
|
|
1036
|
-
*
|
|
1037
|
-
* Or with full wrapper override (if you need assign class to `<pre>`):
|
|
1038
|
-
*
|
|
1039
|
-
* ```javascript
|
|
1040
|
-
* var hljs = require('highlight.js') // https://highlightjs.org/
|
|
1041
|
-
*
|
|
1042
|
-
* // Actual default values
|
|
1043
|
-
* var md = require('markdown-it')({
|
|
1044
|
-
* highlight: function (str, lang) {
|
|
1045
|
-
* if (lang && hljs.getLanguage(lang)) {
|
|
1046
|
-
* try {
|
|
1047
|
-
* return '<pre class="hljs"><code>' +
|
|
1048
|
-
* hljs.highlight(lang, str, true).value +
|
|
1049
|
-
* '</code></pre>';
|
|
1050
|
-
* } catch (__) {}
|
|
1051
|
-
* }
|
|
1052
|
-
*
|
|
1053
|
-
* return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
|
|
1054
|
-
* }
|
|
1055
|
-
* });
|
|
1056
|
-
* ```
|
|
1057
|
-
*/
|
|
1058
|
-
declare const MarkdownIt: MarkdownItConstructor;
|
|
1059
|
-
//#endregion
|
|
1060
4
|
//#region src/node/markdown.d.ts
|
|
1061
5
|
declare const SCRIPT_RE: RegExp;
|
|
1062
6
|
declare const SFC_IMPORTER_RE: RegExp;
|
|
7
|
+
declare function createDefaultSfcBlock(): SfcBlock;
|
|
8
|
+
declare function createVirtualImport(content: string): Pick<SFC, "hash" | "name" | "importer" | "renderedContent">;
|
|
1063
9
|
interface SFC {
|
|
1064
10
|
name: string;
|
|
1065
|
-
content: string;
|
|
1066
11
|
hash: string;
|
|
1067
12
|
importer: string;
|
|
1068
|
-
|
|
13
|
+
content: string;
|
|
14
|
+
renderedContent: string;
|
|
15
|
+
markupParams: ComponentViewProps;
|
|
1069
16
|
}
|
|
1070
17
|
interface MarkdownEnvExt extends MarkdownEnv {
|
|
1071
18
|
sfcs: SFC[];
|
|
1072
19
|
__matched_sfc_set__: Set<string>;
|
|
1073
20
|
}
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
filepath?: string;
|
|
1077
|
-
component?: string;
|
|
1078
|
-
}
|
|
1079
|
-
declare const sfcPlugin: PluginSimple;
|
|
21
|
+
declare function plugin(md: MarkdownRenderer): void;
|
|
22
|
+
declare const sfcPlugin: typeof plugin;
|
|
1080
23
|
//#endregion
|
|
1081
24
|
//#region src/node/vite.d.ts
|
|
1082
25
|
declare function sfcRegistryVitePlugin(): Promise<Plugin>;
|
|
1083
26
|
//#endregion
|
|
1084
|
-
export { MarkdownEnvExt,
|
|
27
|
+
export { MarkdownEnvExt, SCRIPT_RE, SFC, SFC_IMPORTER_RE, createDefaultSfcBlock, createVirtualImport, sfcPlugin, sfcRegistryVitePlugin };
|