marked 15.0.0 → 15.0.2
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.cjs +63 -65
- package/lib/marked.cjs.map +1 -1
- package/lib/marked.d.cts +107 -107
- package/lib/marked.d.ts +107 -107
- package/lib/marked.esm.js +63 -65
- package/lib/marked.esm.js.map +1 -1
- package/lib/marked.umd.js +63 -65
- package/lib/marked.umd.js.map +1 -1
- package/man/marked.1 +1 -1
- package/marked.min.js +2 -2
- package/package.json +6 -8
package/lib/marked.d.cts
CHANGED
|
@@ -1,79 +1,74 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
-
export type MarkedToken = (Tokens.
|
|
3
|
+
export type MarkedToken = (Tokens.Blockquote | Tokens.Br | Tokens.Code | Tokens.Codespan | Tokens.Def | Tokens.Del | Tokens.Em | Tokens.Escape | Tokens.Heading | Tokens.Hr | Tokens.HTML | Tokens.Image | Tokens.Link | Tokens.List | Tokens.ListItem | Tokens.Paragraph | Tokens.Space | Tokens.Strong | Tokens.Table | Tokens.Tag | Tokens.Text);
|
|
4
4
|
export type Token = (MarkedToken | Tokens.Generic);
|
|
5
5
|
export declare namespace Tokens {
|
|
6
|
-
interface
|
|
7
|
-
type: "
|
|
6
|
+
interface Blockquote {
|
|
7
|
+
type: "blockquote";
|
|
8
|
+
raw: string;
|
|
9
|
+
text: string;
|
|
10
|
+
tokens: Token[];
|
|
11
|
+
}
|
|
12
|
+
interface Br {
|
|
13
|
+
type: "br";
|
|
8
14
|
raw: string;
|
|
9
15
|
}
|
|
16
|
+
interface Checkbox {
|
|
17
|
+
checked: boolean;
|
|
18
|
+
}
|
|
10
19
|
interface Code {
|
|
11
20
|
type: "code";
|
|
12
21
|
raw: string;
|
|
13
|
-
codeBlockStyle?: "indented"
|
|
14
|
-
lang?: string
|
|
22
|
+
codeBlockStyle?: "indented";
|
|
23
|
+
lang?: string;
|
|
15
24
|
text: string;
|
|
16
25
|
escaped?: boolean;
|
|
17
26
|
}
|
|
18
|
-
interface
|
|
19
|
-
type: "
|
|
27
|
+
interface Codespan {
|
|
28
|
+
type: "codespan";
|
|
20
29
|
raw: string;
|
|
21
|
-
depth: number;
|
|
22
30
|
text: string;
|
|
23
|
-
tokens: Token[];
|
|
24
31
|
}
|
|
25
|
-
interface
|
|
26
|
-
type: "
|
|
32
|
+
interface Def {
|
|
33
|
+
type: "def";
|
|
27
34
|
raw: string;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
interface TableRow {
|
|
33
|
-
text: string;
|
|
35
|
+
tag: string;
|
|
36
|
+
href: string;
|
|
37
|
+
title: string;
|
|
34
38
|
}
|
|
35
|
-
interface
|
|
39
|
+
interface Del {
|
|
40
|
+
type: "del";
|
|
41
|
+
raw: string;
|
|
36
42
|
text: string;
|
|
37
43
|
tokens: Token[];
|
|
38
|
-
header: boolean;
|
|
39
|
-
align: "center" | "left" | "right" | null;
|
|
40
44
|
}
|
|
41
|
-
interface
|
|
42
|
-
type: "
|
|
45
|
+
interface Em {
|
|
46
|
+
type: "em";
|
|
43
47
|
raw: string;
|
|
48
|
+
text: string;
|
|
49
|
+
tokens: Token[];
|
|
44
50
|
}
|
|
45
|
-
interface
|
|
46
|
-
type: "
|
|
51
|
+
interface Escape {
|
|
52
|
+
type: "escape";
|
|
47
53
|
raw: string;
|
|
48
54
|
text: string;
|
|
49
|
-
tokens: Token[];
|
|
50
55
|
}
|
|
51
|
-
interface
|
|
52
|
-
|
|
56
|
+
interface Generic {
|
|
57
|
+
[index: string]: any;
|
|
58
|
+
type: string;
|
|
53
59
|
raw: string;
|
|
54
|
-
|
|
55
|
-
start: number | "";
|
|
56
|
-
loose: boolean;
|
|
57
|
-
items: ListItem[];
|
|
60
|
+
tokens?: Token[];
|
|
58
61
|
}
|
|
59
|
-
interface
|
|
60
|
-
type: "
|
|
62
|
+
interface Heading {
|
|
63
|
+
type: "heading";
|
|
61
64
|
raw: string;
|
|
62
|
-
|
|
63
|
-
checked?: boolean | undefined;
|
|
64
|
-
loose: boolean;
|
|
65
|
+
depth: number;
|
|
65
66
|
text: string;
|
|
66
67
|
tokens: Token[];
|
|
67
68
|
}
|
|
68
|
-
interface
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
interface Paragraph {
|
|
72
|
-
type: "paragraph";
|
|
69
|
+
interface Hr {
|
|
70
|
+
type: "hr";
|
|
73
71
|
raw: string;
|
|
74
|
-
pre?: boolean | undefined;
|
|
75
|
-
text: string;
|
|
76
|
-
tokens: Token[];
|
|
77
72
|
}
|
|
78
73
|
interface HTML {
|
|
79
74
|
type: "html";
|
|
@@ -82,47 +77,48 @@ export declare namespace Tokens {
|
|
|
82
77
|
text: string;
|
|
83
78
|
block: boolean;
|
|
84
79
|
}
|
|
85
|
-
interface
|
|
86
|
-
type: "
|
|
80
|
+
interface Image {
|
|
81
|
+
type: "image";
|
|
87
82
|
raw: string;
|
|
83
|
+
href: string;
|
|
84
|
+
title: string | null;
|
|
88
85
|
text: string;
|
|
89
|
-
tokens?: Token[];
|
|
90
|
-
escaped?: boolean;
|
|
91
86
|
}
|
|
92
|
-
interface
|
|
93
|
-
type: "
|
|
87
|
+
interface Link {
|
|
88
|
+
type: "link";
|
|
94
89
|
raw: string;
|
|
95
|
-
tag: string;
|
|
96
90
|
href: string;
|
|
97
|
-
title
|
|
91
|
+
title?: string | null;
|
|
92
|
+
text: string;
|
|
93
|
+
tokens: Token[];
|
|
98
94
|
}
|
|
99
|
-
interface
|
|
100
|
-
type: "
|
|
95
|
+
interface List {
|
|
96
|
+
type: "list";
|
|
101
97
|
raw: string;
|
|
102
|
-
|
|
98
|
+
ordered: boolean;
|
|
99
|
+
start: number | "";
|
|
100
|
+
loose: boolean;
|
|
101
|
+
items: ListItem[];
|
|
103
102
|
}
|
|
104
|
-
interface
|
|
105
|
-
type: "
|
|
103
|
+
interface ListItem {
|
|
104
|
+
type: "list_item";
|
|
106
105
|
raw: string;
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
task: boolean;
|
|
107
|
+
checked?: boolean;
|
|
108
|
+
loose: boolean;
|
|
109
109
|
text: string;
|
|
110
|
-
|
|
110
|
+
tokens: Token[];
|
|
111
111
|
}
|
|
112
|
-
interface
|
|
113
|
-
type: "
|
|
112
|
+
interface Paragraph {
|
|
113
|
+
type: "paragraph";
|
|
114
114
|
raw: string;
|
|
115
|
-
|
|
116
|
-
title?: string | null;
|
|
115
|
+
pre?: boolean;
|
|
117
116
|
text: string;
|
|
118
117
|
tokens: Token[];
|
|
119
118
|
}
|
|
120
|
-
interface
|
|
121
|
-
type: "
|
|
119
|
+
interface Space {
|
|
120
|
+
type: "space";
|
|
122
121
|
raw: string;
|
|
123
|
-
href: string;
|
|
124
|
-
title: string | null;
|
|
125
|
-
text: string;
|
|
126
122
|
}
|
|
127
123
|
interface Strong {
|
|
128
124
|
type: "strong";
|
|
@@ -130,32 +126,36 @@ export declare namespace Tokens {
|
|
|
130
126
|
text: string;
|
|
131
127
|
tokens: Token[];
|
|
132
128
|
}
|
|
133
|
-
interface
|
|
134
|
-
type: "
|
|
129
|
+
interface Table {
|
|
130
|
+
type: "table";
|
|
135
131
|
raw: string;
|
|
132
|
+
align: Array<"center" | "left" | "right" | null>;
|
|
133
|
+
header: TableCell[];
|
|
134
|
+
rows: TableCell[][];
|
|
135
|
+
}
|
|
136
|
+
interface TableCell {
|
|
136
137
|
text: string;
|
|
137
138
|
tokens: Token[];
|
|
139
|
+
header: boolean;
|
|
140
|
+
align: "center" | "left" | "right" | null;
|
|
138
141
|
}
|
|
139
|
-
interface
|
|
140
|
-
type: "codespan";
|
|
141
|
-
raw: string;
|
|
142
|
+
interface TableRow {
|
|
142
143
|
text: string;
|
|
143
144
|
}
|
|
144
|
-
interface
|
|
145
|
-
type: "
|
|
146
|
-
raw: string;
|
|
147
|
-
}
|
|
148
|
-
interface Del {
|
|
149
|
-
type: "del";
|
|
145
|
+
interface Tag {
|
|
146
|
+
type: "html";
|
|
150
147
|
raw: string;
|
|
148
|
+
inLink: boolean;
|
|
149
|
+
inRawBlock: boolean;
|
|
151
150
|
text: string;
|
|
152
|
-
|
|
151
|
+
block: boolean;
|
|
153
152
|
}
|
|
154
|
-
interface
|
|
155
|
-
|
|
156
|
-
type: string;
|
|
153
|
+
interface Text {
|
|
154
|
+
type: "text";
|
|
157
155
|
raw: string;
|
|
158
|
-
|
|
156
|
+
text: string;
|
|
157
|
+
tokens?: Token[];
|
|
158
|
+
escaped?: boolean;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
export type Links = Record<string, Pick<Tokens.Link | Tokens.Image, "href" | "title">>;
|
|
@@ -370,7 +370,7 @@ declare class _Tokenizer {
|
|
|
370
370
|
}
|
|
371
371
|
declare class _Hooks {
|
|
372
372
|
options: MarkedOptions;
|
|
373
|
-
block
|
|
373
|
+
block?: boolean;
|
|
374
374
|
constructor(options?: MarkedOptions);
|
|
375
375
|
static passThroughHooks: Set<string>;
|
|
376
376
|
/**
|
|
@@ -402,9 +402,9 @@ export type TokenizerStartFunction = (this: TokenizerThis, src: string) => numbe
|
|
|
402
402
|
export interface TokenizerExtension {
|
|
403
403
|
name: string;
|
|
404
404
|
level: "block" | "inline";
|
|
405
|
-
start?: TokenizerStartFunction
|
|
405
|
+
start?: TokenizerStartFunction;
|
|
406
406
|
tokenizer: TokenizerExtensionFunction;
|
|
407
|
-
childTokens?: string[]
|
|
407
|
+
childTokens?: string[];
|
|
408
408
|
}
|
|
409
409
|
export interface RendererThis {
|
|
410
410
|
parser: _Parser;
|
|
@@ -435,15 +435,15 @@ export interface MarkedExtension {
|
|
|
435
435
|
/**
|
|
436
436
|
* Enable GFM line breaks. This option requires the gfm option to be true.
|
|
437
437
|
*/
|
|
438
|
-
breaks?: boolean
|
|
438
|
+
breaks?: boolean;
|
|
439
439
|
/**
|
|
440
440
|
* Add tokenizers and renderers to marked
|
|
441
441
|
*/
|
|
442
|
-
extensions?: TokenizerAndRendererExtension[] |
|
|
442
|
+
extensions?: TokenizerAndRendererExtension[] | null;
|
|
443
443
|
/**
|
|
444
444
|
* Enable GitHub flavored markdown.
|
|
445
445
|
*/
|
|
446
|
-
gfm?: boolean
|
|
446
|
+
gfm?: boolean;
|
|
447
447
|
/**
|
|
448
448
|
* Hooks are methods that hook into some part of marked.
|
|
449
449
|
* preprocess is called to process markdown before sending it to marked.
|
|
@@ -452,48 +452,48 @@ export interface MarkedExtension {
|
|
|
452
452
|
* provideLexer is called to provide a function to tokenize markdown.
|
|
453
453
|
* provideParser is called to provide a function to parse tokens.
|
|
454
454
|
*/
|
|
455
|
-
hooks?: HooksObject |
|
|
455
|
+
hooks?: HooksObject | null;
|
|
456
456
|
/**
|
|
457
457
|
* Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.
|
|
458
458
|
*/
|
|
459
|
-
pedantic?: boolean
|
|
459
|
+
pedantic?: boolean;
|
|
460
460
|
/**
|
|
461
461
|
* Type: object Default: new Renderer()
|
|
462
462
|
*
|
|
463
463
|
* An object containing functions to render tokens to HTML.
|
|
464
464
|
*/
|
|
465
|
-
renderer?: RendererObject |
|
|
465
|
+
renderer?: RendererObject | null;
|
|
466
466
|
/**
|
|
467
467
|
* Shows an HTML error message when rendering fails.
|
|
468
468
|
*/
|
|
469
|
-
silent?: boolean
|
|
469
|
+
silent?: boolean;
|
|
470
470
|
/**
|
|
471
471
|
* The tokenizer defines how to turn markdown text into tokens.
|
|
472
472
|
*/
|
|
473
|
-
tokenizer?: TokenizerObject |
|
|
473
|
+
tokenizer?: TokenizerObject | null;
|
|
474
474
|
/**
|
|
475
475
|
* The walkTokens function gets called with every token.
|
|
476
476
|
* Child tokens are called before moving on to sibling tokens.
|
|
477
477
|
* Each token is passed by reference so updates are persisted when passed to the parser.
|
|
478
478
|
* The return value of the function is ignored.
|
|
479
479
|
*/
|
|
480
|
-
walkTokens?: ((token: Token) => void | Promise<void>) |
|
|
480
|
+
walkTokens?: ((token: Token) => void | Promise<void>) | null;
|
|
481
481
|
}
|
|
482
482
|
export interface MarkedOptions extends Omit<MarkedExtension, "hooks" | "renderer" | "tokenizer" | "extensions" | "walkTokens"> {
|
|
483
483
|
/**
|
|
484
484
|
* Hooks are methods that hook into some part of marked.
|
|
485
485
|
*/
|
|
486
|
-
hooks?: _Hooks |
|
|
486
|
+
hooks?: _Hooks | null;
|
|
487
487
|
/**
|
|
488
488
|
* Type: object Default: new Renderer()
|
|
489
489
|
*
|
|
490
490
|
* An object containing functions to render tokens to HTML.
|
|
491
491
|
*/
|
|
492
|
-
renderer?: _Renderer |
|
|
492
|
+
renderer?: _Renderer | null;
|
|
493
493
|
/**
|
|
494
494
|
* The tokenizer defines how to turn markdown text into tokens.
|
|
495
495
|
*/
|
|
496
|
-
tokenizer?: _Tokenizer |
|
|
496
|
+
tokenizer?: _Tokenizer | null;
|
|
497
497
|
/**
|
|
498
498
|
* Custom extensions
|
|
499
499
|
*/
|
|
@@ -548,8 +548,8 @@ declare class _Lexer {
|
|
|
548
548
|
table: RegExp;
|
|
549
549
|
text: RegExp;
|
|
550
550
|
};
|
|
551
|
-
gfm: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "
|
|
552
|
-
pedantic: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "
|
|
551
|
+
gfm: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "def" | "heading" | "list" | "paragraph" | "fences" | "lheading" | "newline", RegExp>;
|
|
552
|
+
pedantic: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "def" | "heading" | "list" | "paragraph" | "fences" | "lheading" | "newline", RegExp>;
|
|
553
553
|
};
|
|
554
554
|
inline: {
|
|
555
555
|
normal: {
|
|
@@ -617,7 +617,7 @@ export declare class Marked {
|
|
|
617
617
|
(src: string, options: MarkedOptions & {
|
|
618
618
|
async: false;
|
|
619
619
|
}): string;
|
|
620
|
-
(src: string, options?: MarkedOptions |
|
|
620
|
+
(src: string, options?: MarkedOptions | null): string | Promise<string>;
|
|
621
621
|
};
|
|
622
622
|
parseInline: {
|
|
623
623
|
(src: string, options: MarkedOptions & {
|
|
@@ -626,7 +626,7 @@ export declare class Marked {
|
|
|
626
626
|
(src: string, options: MarkedOptions & {
|
|
627
627
|
async: false;
|
|
628
628
|
}): string;
|
|
629
|
-
(src: string, options?: MarkedOptions |
|
|
629
|
+
(src: string, options?: MarkedOptions | null): string | Promise<string>;
|
|
630
630
|
};
|
|
631
631
|
Parser: typeof _Parser;
|
|
632
632
|
Renderer: typeof _Renderer;
|
|
@@ -669,7 +669,7 @@ export declare function marked(src: string, options: MarkedOptions & {
|
|
|
669
669
|
export declare function marked(src: string, options: MarkedOptions & {
|
|
670
670
|
async: true;
|
|
671
671
|
}): Promise<string>;
|
|
672
|
-
export declare function marked(src: string, options?: MarkedOptions |
|
|
672
|
+
export declare function marked(src: string, options?: MarkedOptions | null): string | Promise<string>;
|
|
673
673
|
export declare namespace marked {
|
|
674
674
|
var options: (options: MarkedOptions) => typeof marked;
|
|
675
675
|
var setOptions: (options: MarkedOptions) => typeof marked;
|
|
@@ -684,7 +684,7 @@ export declare namespace marked {
|
|
|
684
684
|
(src: string, options: MarkedOptions & {
|
|
685
685
|
async: false;
|
|
686
686
|
}): string;
|
|
687
|
-
(src: string, options?: MarkedOptions |
|
|
687
|
+
(src: string, options?: MarkedOptions | null): string | Promise<string>;
|
|
688
688
|
};
|
|
689
689
|
var Parser: typeof _Parser;
|
|
690
690
|
var parser: typeof _Parser.parse;
|
|
@@ -707,7 +707,7 @@ export declare const parseInline: {
|
|
|
707
707
|
(src: string, options: MarkedOptions & {
|
|
708
708
|
async: false;
|
|
709
709
|
}): string;
|
|
710
|
-
(src: string, options?: MarkedOptions |
|
|
710
|
+
(src: string, options?: MarkedOptions | null): string | Promise<string>;
|
|
711
711
|
};
|
|
712
712
|
export declare const parse: typeof marked;
|
|
713
713
|
export declare const parser: typeof _Parser.parse;
|