marked 10.0.0 → 11.0.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/marked.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- // Generated by dts-bundle-generator v8.0.1
1
+ // Generated by dts-bundle-generator v8.1.2
2
2
 
3
3
  export type Token = (Tokens.Space | Tokens.Code | Tokens.Heading | Tokens.Table | Tokens.Hr | Tokens.Blockquote | Tokens.List | Tokens.ListItem | Tokens.Paragraph | Tokens.HTML | Tokens.Text | Tokens.Def | Tokens.Escape | Tokens.Tag | Tokens.Image | Tokens.Link | Tokens.Strong | Tokens.Em | Tokens.Codespan | Tokens.Br | Tokens.Del | Tokens.Generic);
4
4
  export declare namespace Tokens {
@@ -215,9 +215,99 @@ declare class _Parser {
215
215
  */
216
216
  parseInline(tokens: Token[], renderer?: _Renderer | _TextRenderer): string;
217
217
  }
218
+ declare const blockNormal: {
219
+ blockquote: RegExp;
220
+ code: RegExp;
221
+ def: RegExp;
222
+ fences: RegExp;
223
+ heading: RegExp;
224
+ hr: RegExp;
225
+ html: RegExp;
226
+ lheading: RegExp;
227
+ list: RegExp;
228
+ newline: RegExp;
229
+ paragraph: RegExp;
230
+ table: RegExp;
231
+ text: RegExp;
232
+ };
233
+ export type BlockKeys = keyof typeof blockNormal;
234
+ declare const inlineNormal: {
235
+ _backpedal: RegExp;
236
+ anyPunctuation: RegExp;
237
+ autolink: RegExp;
238
+ blockSkip: RegExp;
239
+ br: RegExp;
240
+ code: RegExp;
241
+ del: RegExp;
242
+ emStrongLDelim: RegExp;
243
+ emStrongRDelimAst: RegExp;
244
+ emStrongRDelimUnd: RegExp;
245
+ escape: RegExp;
246
+ link: RegExp;
247
+ nolink: RegExp;
248
+ punctuation: RegExp;
249
+ reflink: RegExp;
250
+ reflinkSearch: RegExp;
251
+ tag: RegExp;
252
+ text: RegExp;
253
+ url: RegExp;
254
+ };
255
+ export type InlineKeys = keyof typeof inlineNormal;
256
+ /**
257
+ * exports
258
+ */
259
+ export declare const block: {
260
+ normal: {
261
+ blockquote: RegExp;
262
+ code: RegExp;
263
+ def: RegExp;
264
+ fences: RegExp;
265
+ heading: RegExp;
266
+ hr: RegExp;
267
+ html: RegExp;
268
+ lheading: RegExp;
269
+ list: RegExp;
270
+ newline: RegExp;
271
+ paragraph: RegExp;
272
+ table: RegExp;
273
+ text: RegExp;
274
+ };
275
+ gfm: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
276
+ pedantic: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
277
+ };
278
+ export declare const inline: {
279
+ normal: {
280
+ _backpedal: RegExp;
281
+ anyPunctuation: RegExp;
282
+ autolink: RegExp;
283
+ blockSkip: RegExp;
284
+ br: RegExp;
285
+ code: RegExp;
286
+ del: RegExp;
287
+ emStrongLDelim: RegExp;
288
+ emStrongRDelimAst: RegExp;
289
+ emStrongRDelimUnd: RegExp;
290
+ escape: RegExp;
291
+ link: RegExp;
292
+ nolink: RegExp;
293
+ punctuation: RegExp;
294
+ reflink: RegExp;
295
+ reflinkSearch: RegExp;
296
+ tag: RegExp;
297
+ text: RegExp;
298
+ url: RegExp;
299
+ };
300
+ gfm: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
301
+ breaks: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
302
+ pedantic: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
303
+ };
304
+ export interface Rules {
305
+ block: Record<BlockKeys, RegExp>;
306
+ inline: Record<InlineKeys, RegExp>;
307
+ }
218
308
  declare class _Tokenizer {
219
309
  options: MarkedOptions;
220
- rules: any;
310
+ rules: Rules;
221
311
  lexer: _Lexer;
222
312
  constructor(options?: MarkedOptions);
223
313
  space(src: string): Tokens.Space | undefined;
@@ -358,22 +448,6 @@ export interface MarkedOptions extends Omit<MarkedExtension, "renderer" | "token
358
448
  */
359
449
  walkTokens?: null | ((token: Token) => void | Promise<void> | (void | Promise<void>)[]);
360
450
  }
361
- export type Rule = RegExp | string;
362
- export interface Rules {
363
- [ruleName: string]: Pick<RegExp, "exec"> | Rule | Rules;
364
- }
365
- export type BlockRuleNames = "newline" | "code" | "fences" | "hr" | "heading" | "blockquote" | "list" | "html" | "def" | "lheading" | "_paragraph" | "text" | "_label" | "_title" | "bullet" | "listItemStart" | "_tag" | "_comment" | "paragraph" | "uote";
366
- export type BlockSubRuleNames = "normal" | "gfm" | "pedantic";
367
- export type InlineRuleNames = "escape" | "autolink" | "tag" | "link" | "reflink" | "nolink" | "reflinkSearch" | "code" | "br" | "text" | "_punctuation" | "punctuation" | "blockSkip" | "escapedEmSt" | "_comment" | "_escapes" | "_scheme" | "_email" | "_attribute" | "_label" | "_href" | "_title" | "strong" | "_extended_email" | "_backpedal";
368
- export type InlineSubRuleNames = "gfm" | "emStrong" | "normal" | "pedantic" | "breaks";
369
- /**
370
- * Block-Level Grammar
371
- */
372
- export declare const block: Record<BlockRuleNames, Rule> & Record<BlockSubRuleNames, Rules> & Rules;
373
- /**
374
- * Inline-Level Grammar
375
- */
376
- export declare const inline: Record<InlineRuleNames, Rule> & Record<InlineSubRuleNames, Rules> & Rules;
377
451
  declare class _Lexer {
378
452
  tokens: TokensList;
379
453
  options: MarkedOptions;
@@ -388,7 +462,53 @@ declare class _Lexer {
388
462
  /**
389
463
  * Expose Rules
390
464
  */
391
- static get rules(): Rules;
465
+ static get rules(): {
466
+ block: {
467
+ normal: {
468
+ blockquote: RegExp;
469
+ code: RegExp;
470
+ def: RegExp;
471
+ fences: RegExp;
472
+ heading: RegExp;
473
+ hr: RegExp;
474
+ html: RegExp;
475
+ lheading: RegExp;
476
+ list: RegExp;
477
+ newline: RegExp;
478
+ paragraph: RegExp;
479
+ table: RegExp;
480
+ text: RegExp;
481
+ };
482
+ gfm: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
483
+ pedantic: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
484
+ };
485
+ inline: {
486
+ normal: {
487
+ _backpedal: RegExp;
488
+ anyPunctuation: RegExp;
489
+ autolink: RegExp;
490
+ blockSkip: RegExp;
491
+ br: RegExp;
492
+ code: RegExp;
493
+ del: RegExp;
494
+ emStrongLDelim: RegExp;
495
+ emStrongRDelimAst: RegExp;
496
+ emStrongRDelimUnd: RegExp;
497
+ escape: RegExp;
498
+ link: RegExp;
499
+ nolink: RegExp;
500
+ punctuation: RegExp;
501
+ reflink: RegExp;
502
+ reflinkSearch: RegExp;
503
+ tag: RegExp;
504
+ text: RegExp;
505
+ url: RegExp;
506
+ };
507
+ gfm: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
508
+ breaks: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
509
+ pedantic: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
510
+ };
511
+ };
392
512
  /**
393
513
  * Static Lex Method
394
514
  */
@@ -461,13 +581,13 @@ export declare function marked(src: string, options: MarkedOptions & {
461
581
  async: true;
462
582
  }): Promise<string>;
463
583
  /**
464
- * Compiles markdown to HTML synchronously.
584
+ * Compiles markdown to HTML.
465
585
  *
466
586
  * @param src String of markdown source to be compiled
467
587
  * @param options Optional hash of options
468
- * @return String of compiled HTML
588
+ * @return String of compiled HTML. Wil be a Promise of string if async is set to true by any extensions.
469
589
  */
470
- export declare function marked(src: string, options?: MarkedOptions): string;
590
+ export declare function marked(src: string, options?: MarkedOptions): string | Promise<string>;
471
591
  export declare namespace marked {
472
592
  var options: (options: MarkedOptions) => typeof marked;
473
593
  var setOptions: (options: MarkedOptions) => typeof marked;
package/lib/marked.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Generated by dts-bundle-generator v8.0.1
1
+ // Generated by dts-bundle-generator v8.1.2
2
2
 
3
3
  export type Token = (Tokens.Space | Tokens.Code | Tokens.Heading | Tokens.Table | Tokens.Hr | Tokens.Blockquote | Tokens.List | Tokens.ListItem | Tokens.Paragraph | Tokens.HTML | Tokens.Text | Tokens.Def | Tokens.Escape | Tokens.Tag | Tokens.Image | Tokens.Link | Tokens.Strong | Tokens.Em | Tokens.Codespan | Tokens.Br | Tokens.Del | Tokens.Generic);
4
4
  export declare namespace Tokens {
@@ -215,9 +215,99 @@ declare class _Parser {
215
215
  */
216
216
  parseInline(tokens: Token[], renderer?: _Renderer | _TextRenderer): string;
217
217
  }
218
+ declare const blockNormal: {
219
+ blockquote: RegExp;
220
+ code: RegExp;
221
+ def: RegExp;
222
+ fences: RegExp;
223
+ heading: RegExp;
224
+ hr: RegExp;
225
+ html: RegExp;
226
+ lheading: RegExp;
227
+ list: RegExp;
228
+ newline: RegExp;
229
+ paragraph: RegExp;
230
+ table: RegExp;
231
+ text: RegExp;
232
+ };
233
+ export type BlockKeys = keyof typeof blockNormal;
234
+ declare const inlineNormal: {
235
+ _backpedal: RegExp;
236
+ anyPunctuation: RegExp;
237
+ autolink: RegExp;
238
+ blockSkip: RegExp;
239
+ br: RegExp;
240
+ code: RegExp;
241
+ del: RegExp;
242
+ emStrongLDelim: RegExp;
243
+ emStrongRDelimAst: RegExp;
244
+ emStrongRDelimUnd: RegExp;
245
+ escape: RegExp;
246
+ link: RegExp;
247
+ nolink: RegExp;
248
+ punctuation: RegExp;
249
+ reflink: RegExp;
250
+ reflinkSearch: RegExp;
251
+ tag: RegExp;
252
+ text: RegExp;
253
+ url: RegExp;
254
+ };
255
+ export type InlineKeys = keyof typeof inlineNormal;
256
+ /**
257
+ * exports
258
+ */
259
+ export declare const block: {
260
+ normal: {
261
+ blockquote: RegExp;
262
+ code: RegExp;
263
+ def: RegExp;
264
+ fences: RegExp;
265
+ heading: RegExp;
266
+ hr: RegExp;
267
+ html: RegExp;
268
+ lheading: RegExp;
269
+ list: RegExp;
270
+ newline: RegExp;
271
+ paragraph: RegExp;
272
+ table: RegExp;
273
+ text: RegExp;
274
+ };
275
+ gfm: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
276
+ pedantic: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
277
+ };
278
+ export declare const inline: {
279
+ normal: {
280
+ _backpedal: RegExp;
281
+ anyPunctuation: RegExp;
282
+ autolink: RegExp;
283
+ blockSkip: RegExp;
284
+ br: RegExp;
285
+ code: RegExp;
286
+ del: RegExp;
287
+ emStrongLDelim: RegExp;
288
+ emStrongRDelimAst: RegExp;
289
+ emStrongRDelimUnd: RegExp;
290
+ escape: RegExp;
291
+ link: RegExp;
292
+ nolink: RegExp;
293
+ punctuation: RegExp;
294
+ reflink: RegExp;
295
+ reflinkSearch: RegExp;
296
+ tag: RegExp;
297
+ text: RegExp;
298
+ url: RegExp;
299
+ };
300
+ gfm: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
301
+ breaks: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
302
+ pedantic: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
303
+ };
304
+ export interface Rules {
305
+ block: Record<BlockKeys, RegExp>;
306
+ inline: Record<InlineKeys, RegExp>;
307
+ }
218
308
  declare class _Tokenizer {
219
309
  options: MarkedOptions;
220
- rules: any;
310
+ rules: Rules;
221
311
  lexer: _Lexer;
222
312
  constructor(options?: MarkedOptions);
223
313
  space(src: string): Tokens.Space | undefined;
@@ -358,22 +448,6 @@ export interface MarkedOptions extends Omit<MarkedExtension, "renderer" | "token
358
448
  */
359
449
  walkTokens?: null | ((token: Token) => void | Promise<void> | (void | Promise<void>)[]);
360
450
  }
361
- export type Rule = RegExp | string;
362
- export interface Rules {
363
- [ruleName: string]: Pick<RegExp, "exec"> | Rule | Rules;
364
- }
365
- export type BlockRuleNames = "newline" | "code" | "fences" | "hr" | "heading" | "blockquote" | "list" | "html" | "def" | "lheading" | "_paragraph" | "text" | "_label" | "_title" | "bullet" | "listItemStart" | "_tag" | "_comment" | "paragraph" | "uote";
366
- export type BlockSubRuleNames = "normal" | "gfm" | "pedantic";
367
- export type InlineRuleNames = "escape" | "autolink" | "tag" | "link" | "reflink" | "nolink" | "reflinkSearch" | "code" | "br" | "text" | "_punctuation" | "punctuation" | "blockSkip" | "escapedEmSt" | "_comment" | "_escapes" | "_scheme" | "_email" | "_attribute" | "_label" | "_href" | "_title" | "strong" | "_extended_email" | "_backpedal";
368
- export type InlineSubRuleNames = "gfm" | "emStrong" | "normal" | "pedantic" | "breaks";
369
- /**
370
- * Block-Level Grammar
371
- */
372
- export declare const block: Record<BlockRuleNames, Rule> & Record<BlockSubRuleNames, Rules> & Rules;
373
- /**
374
- * Inline-Level Grammar
375
- */
376
- export declare const inline: Record<InlineRuleNames, Rule> & Record<InlineSubRuleNames, Rules> & Rules;
377
451
  declare class _Lexer {
378
452
  tokens: TokensList;
379
453
  options: MarkedOptions;
@@ -388,7 +462,53 @@ declare class _Lexer {
388
462
  /**
389
463
  * Expose Rules
390
464
  */
391
- static get rules(): Rules;
465
+ static get rules(): {
466
+ block: {
467
+ normal: {
468
+ blockquote: RegExp;
469
+ code: RegExp;
470
+ def: RegExp;
471
+ fences: RegExp;
472
+ heading: RegExp;
473
+ hr: RegExp;
474
+ html: RegExp;
475
+ lheading: RegExp;
476
+ list: RegExp;
477
+ newline: RegExp;
478
+ paragraph: RegExp;
479
+ table: RegExp;
480
+ text: RegExp;
481
+ };
482
+ gfm: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
483
+ pedantic: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "heading" | "list" | "paragraph" | "def" | "fences" | "lheading" | "newline", RegExp>;
484
+ };
485
+ inline: {
486
+ normal: {
487
+ _backpedal: RegExp;
488
+ anyPunctuation: RegExp;
489
+ autolink: RegExp;
490
+ blockSkip: RegExp;
491
+ br: RegExp;
492
+ code: RegExp;
493
+ del: RegExp;
494
+ emStrongLDelim: RegExp;
495
+ emStrongRDelimAst: RegExp;
496
+ emStrongRDelimUnd: RegExp;
497
+ escape: RegExp;
498
+ link: RegExp;
499
+ nolink: RegExp;
500
+ punctuation: RegExp;
501
+ reflink: RegExp;
502
+ reflinkSearch: RegExp;
503
+ tag: RegExp;
504
+ text: RegExp;
505
+ url: RegExp;
506
+ };
507
+ gfm: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
508
+ breaks: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
509
+ pedantic: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "autolink" | "nolink" | "_backpedal" | "anyPunctuation" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>;
510
+ };
511
+ };
392
512
  /**
393
513
  * Static Lex Method
394
514
  */
@@ -461,13 +581,13 @@ export declare function marked(src: string, options: MarkedOptions & {
461
581
  async: true;
462
582
  }): Promise<string>;
463
583
  /**
464
- * Compiles markdown to HTML synchronously.
584
+ * Compiles markdown to HTML.
465
585
  *
466
586
  * @param src String of markdown source to be compiled
467
587
  * @param options Optional hash of options
468
- * @return String of compiled HTML
588
+ * @return String of compiled HTML. Wil be a Promise of string if async is set to true by any extensions.
469
589
  */
470
- export declare function marked(src: string, options?: MarkedOptions): string;
590
+ export declare function marked(src: string, options?: MarkedOptions): string | Promise<string>;
471
591
  export declare namespace marked {
472
592
  var options: (options: MarkedOptions) => typeof marked;
473
593
  var setOptions: (options: MarkedOptions) => typeof marked;