marked 12.0.2 → 13.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.cjs +438 -162
- package/lib/marked.cjs.map +1 -1
- package/lib/marked.d.cts +50 -37
- package/lib/marked.d.ts +50 -37
- package/lib/marked.esm.js +438 -162
- package/lib/marked.esm.js.map +1 -1
- package/lib/marked.umd.js +438 -162
- package/lib/marked.umd.js.map +1 -1
- package/man/marked.1 +1 -1
- package/marked.min.js +2 -2
- package/package.json +15 -12
package/lib/marked.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator v9.
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
-
export type
|
|
3
|
+
export type MarkedToken = (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);
|
|
4
|
+
export type Token = (MarkedToken | Tokens.Generic);
|
|
4
5
|
export declare namespace Tokens {
|
|
5
6
|
interface Space {
|
|
6
7
|
type: "space";
|
|
@@ -28,9 +29,14 @@ export declare namespace Tokens {
|
|
|
28
29
|
header: TableCell[];
|
|
29
30
|
rows: TableCell[][];
|
|
30
31
|
}
|
|
32
|
+
interface TableRow {
|
|
33
|
+
text: string;
|
|
34
|
+
}
|
|
31
35
|
interface TableCell {
|
|
32
36
|
text: string;
|
|
33
37
|
tokens: Token[];
|
|
38
|
+
header: boolean;
|
|
39
|
+
align: "center" | "left" | "right" | null;
|
|
34
40
|
}
|
|
35
41
|
interface Hr {
|
|
36
42
|
type: "hr";
|
|
@@ -59,6 +65,9 @@ export declare namespace Tokens {
|
|
|
59
65
|
text: string;
|
|
60
66
|
tokens: Token[];
|
|
61
67
|
}
|
|
68
|
+
interface Checkbox {
|
|
69
|
+
checked: boolean;
|
|
70
|
+
}
|
|
62
71
|
interface Paragraph {
|
|
63
72
|
type: "paragraph";
|
|
64
73
|
raw: string;
|
|
@@ -157,47 +166,46 @@ export type TokensList = Token[] & {
|
|
|
157
166
|
*/
|
|
158
167
|
declare class _Renderer {
|
|
159
168
|
options: MarkedOptions;
|
|
169
|
+
parser: _Parser;
|
|
160
170
|
constructor(options?: MarkedOptions);
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
align: "center" | "left" | "right" | null;
|
|
175
|
-
}): string;
|
|
171
|
+
space(token: Tokens.Space): string;
|
|
172
|
+
code({ text, lang, escaped }: Tokens.Code): string;
|
|
173
|
+
blockquote({ tokens }: Tokens.Blockquote): string;
|
|
174
|
+
html({ text }: Tokens.HTML | Tokens.Tag): string;
|
|
175
|
+
heading({ tokens, depth }: Tokens.Heading): string;
|
|
176
|
+
hr(token: Tokens.Hr): string;
|
|
177
|
+
list(token: Tokens.List): string;
|
|
178
|
+
listitem(item: Tokens.ListItem): string;
|
|
179
|
+
checkbox({ checked }: Tokens.Checkbox): string;
|
|
180
|
+
paragraph({ tokens }: Tokens.Paragraph): string;
|
|
181
|
+
table(token: Tokens.Table): string;
|
|
182
|
+
tablerow({ text }: Tokens.TableRow): string;
|
|
183
|
+
tablecell(token: Tokens.TableCell): string;
|
|
176
184
|
/**
|
|
177
185
|
* span level renderer
|
|
178
186
|
*/
|
|
179
|
-
strong(
|
|
180
|
-
em(
|
|
181
|
-
codespan(text:
|
|
182
|
-
br(): string;
|
|
183
|
-
del(
|
|
184
|
-
link(href
|
|
185
|
-
image(href
|
|
186
|
-
text(
|
|
187
|
+
strong({ tokens }: Tokens.Strong): string;
|
|
188
|
+
em({ tokens }: Tokens.Em): string;
|
|
189
|
+
codespan({ text }: Tokens.Codespan): string;
|
|
190
|
+
br(token: Tokens.Br): string;
|
|
191
|
+
del({ tokens }: Tokens.Del): string;
|
|
192
|
+
link({ href, title, tokens }: Tokens.Link): string;
|
|
193
|
+
image({ href, title, text }: Tokens.Image): string;
|
|
194
|
+
text(token: Tokens.Text | Tokens.Escape | Tokens.Tag): string;
|
|
187
195
|
}
|
|
188
196
|
/**
|
|
189
197
|
* TextRenderer
|
|
190
198
|
* returns only the textual part of the token
|
|
191
199
|
*/
|
|
192
200
|
declare class _TextRenderer {
|
|
193
|
-
strong(text:
|
|
194
|
-
em(text:
|
|
195
|
-
codespan(text:
|
|
196
|
-
del(text:
|
|
197
|
-
html(text:
|
|
198
|
-
text(text:
|
|
199
|
-
link(
|
|
200
|
-
image(
|
|
201
|
+
strong({ text }: Tokens.Strong): string;
|
|
202
|
+
em({ text }: Tokens.Em): string;
|
|
203
|
+
codespan({ text }: Tokens.Codespan): string;
|
|
204
|
+
del({ text }: Tokens.Del): string;
|
|
205
|
+
html({ text }: Tokens.HTML | Tokens.Tag): string;
|
|
206
|
+
text({ text }: Tokens.Text | Tokens.Escape | Tokens.Tag): string;
|
|
207
|
+
link({ text }: Tokens.Link): string;
|
|
208
|
+
image({ text }: Tokens.Image): string;
|
|
201
209
|
br(): string;
|
|
202
210
|
}
|
|
203
211
|
/**
|
|
@@ -390,7 +398,7 @@ export type HooksApi = Omit<_Hooks, "constructor" | "options">;
|
|
|
390
398
|
export type HooksObject = {
|
|
391
399
|
[K in keyof HooksApi]?: (...args: Parameters<HooksApi[K]>) => ReturnType<HooksApi[K]> | Promise<ReturnType<HooksApi[K]>>;
|
|
392
400
|
};
|
|
393
|
-
export type RendererApi = Omit<_Renderer, "constructor" | "options">;
|
|
401
|
+
export type RendererApi = Omit<_Renderer, "constructor" | "options" | "parser">;
|
|
394
402
|
export type RendererObject = {
|
|
395
403
|
[K in keyof RendererApi]?: (...args: Parameters<RendererApi[K]>) => ReturnType<RendererApi[K]> | false;
|
|
396
404
|
};
|
|
@@ -447,8 +455,13 @@ export interface MarkedExtension {
|
|
|
447
455
|
* The return value of the function is ignored.
|
|
448
456
|
*/
|
|
449
457
|
walkTokens?: ((token: Token) => void | Promise<void>) | undefined | null;
|
|
458
|
+
/**
|
|
459
|
+
* Use the new renderer that accepts an object instead of individual parameters.
|
|
460
|
+
* This option will be removed and default to true in the next major version.
|
|
461
|
+
*/
|
|
462
|
+
useNewRenderer?: boolean | undefined;
|
|
450
463
|
}
|
|
451
|
-
export interface MarkedOptions extends Omit<MarkedExtension, "hooks" | "renderer" | "tokenizer" | "extensions" | "walkTokens"> {
|
|
464
|
+
export interface MarkedOptions extends Omit<MarkedExtension, "useNewRenderer" | "hooks" | "renderer" | "tokenizer" | "extensions" | "walkTokens"> {
|
|
452
465
|
/**
|
|
453
466
|
* Hooks are methods that hook into some part of marked.
|
|
454
467
|
*/
|
|
@@ -562,8 +575,8 @@ declare class _Lexer {
|
|
|
562
575
|
/**
|
|
563
576
|
* Lexing
|
|
564
577
|
*/
|
|
565
|
-
blockTokens(src: string, tokens?: Token[]): Token[];
|
|
566
|
-
blockTokens(src: string, tokens?: TokensList): TokensList;
|
|
578
|
+
blockTokens(src: string, tokens?: Token[], lastParagraphClipped?: boolean): Token[];
|
|
579
|
+
blockTokens(src: string, tokens?: TokensList, lastParagraphClipped?: boolean): TokensList;
|
|
567
580
|
inline(src: string, tokens?: Token[]): Token[];
|
|
568
581
|
/**
|
|
569
582
|
* Lexing/Compiling
|
package/lib/marked.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator v9.
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
-
export type
|
|
3
|
+
export type MarkedToken = (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);
|
|
4
|
+
export type Token = (MarkedToken | Tokens.Generic);
|
|
4
5
|
export declare namespace Tokens {
|
|
5
6
|
interface Space {
|
|
6
7
|
type: "space";
|
|
@@ -28,9 +29,14 @@ export declare namespace Tokens {
|
|
|
28
29
|
header: TableCell[];
|
|
29
30
|
rows: TableCell[][];
|
|
30
31
|
}
|
|
32
|
+
interface TableRow {
|
|
33
|
+
text: string;
|
|
34
|
+
}
|
|
31
35
|
interface TableCell {
|
|
32
36
|
text: string;
|
|
33
37
|
tokens: Token[];
|
|
38
|
+
header: boolean;
|
|
39
|
+
align: "center" | "left" | "right" | null;
|
|
34
40
|
}
|
|
35
41
|
interface Hr {
|
|
36
42
|
type: "hr";
|
|
@@ -59,6 +65,9 @@ export declare namespace Tokens {
|
|
|
59
65
|
text: string;
|
|
60
66
|
tokens: Token[];
|
|
61
67
|
}
|
|
68
|
+
interface Checkbox {
|
|
69
|
+
checked: boolean;
|
|
70
|
+
}
|
|
62
71
|
interface Paragraph {
|
|
63
72
|
type: "paragraph";
|
|
64
73
|
raw: string;
|
|
@@ -157,47 +166,46 @@ export type TokensList = Token[] & {
|
|
|
157
166
|
*/
|
|
158
167
|
declare class _Renderer {
|
|
159
168
|
options: MarkedOptions;
|
|
169
|
+
parser: _Parser;
|
|
160
170
|
constructor(options?: MarkedOptions);
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
align: "center" | "left" | "right" | null;
|
|
175
|
-
}): string;
|
|
171
|
+
space(token: Tokens.Space): string;
|
|
172
|
+
code({ text, lang, escaped }: Tokens.Code): string;
|
|
173
|
+
blockquote({ tokens }: Tokens.Blockquote): string;
|
|
174
|
+
html({ text }: Tokens.HTML | Tokens.Tag): string;
|
|
175
|
+
heading({ tokens, depth }: Tokens.Heading): string;
|
|
176
|
+
hr(token: Tokens.Hr): string;
|
|
177
|
+
list(token: Tokens.List): string;
|
|
178
|
+
listitem(item: Tokens.ListItem): string;
|
|
179
|
+
checkbox({ checked }: Tokens.Checkbox): string;
|
|
180
|
+
paragraph({ tokens }: Tokens.Paragraph): string;
|
|
181
|
+
table(token: Tokens.Table): string;
|
|
182
|
+
tablerow({ text }: Tokens.TableRow): string;
|
|
183
|
+
tablecell(token: Tokens.TableCell): string;
|
|
176
184
|
/**
|
|
177
185
|
* span level renderer
|
|
178
186
|
*/
|
|
179
|
-
strong(
|
|
180
|
-
em(
|
|
181
|
-
codespan(text:
|
|
182
|
-
br(): string;
|
|
183
|
-
del(
|
|
184
|
-
link(href
|
|
185
|
-
image(href
|
|
186
|
-
text(
|
|
187
|
+
strong({ tokens }: Tokens.Strong): string;
|
|
188
|
+
em({ tokens }: Tokens.Em): string;
|
|
189
|
+
codespan({ text }: Tokens.Codespan): string;
|
|
190
|
+
br(token: Tokens.Br): string;
|
|
191
|
+
del({ tokens }: Tokens.Del): string;
|
|
192
|
+
link({ href, title, tokens }: Tokens.Link): string;
|
|
193
|
+
image({ href, title, text }: Tokens.Image): string;
|
|
194
|
+
text(token: Tokens.Text | Tokens.Escape | Tokens.Tag): string;
|
|
187
195
|
}
|
|
188
196
|
/**
|
|
189
197
|
* TextRenderer
|
|
190
198
|
* returns only the textual part of the token
|
|
191
199
|
*/
|
|
192
200
|
declare class _TextRenderer {
|
|
193
|
-
strong(text:
|
|
194
|
-
em(text:
|
|
195
|
-
codespan(text:
|
|
196
|
-
del(text:
|
|
197
|
-
html(text:
|
|
198
|
-
text(text:
|
|
199
|
-
link(
|
|
200
|
-
image(
|
|
201
|
+
strong({ text }: Tokens.Strong): string;
|
|
202
|
+
em({ text }: Tokens.Em): string;
|
|
203
|
+
codespan({ text }: Tokens.Codespan): string;
|
|
204
|
+
del({ text }: Tokens.Del): string;
|
|
205
|
+
html({ text }: Tokens.HTML | Tokens.Tag): string;
|
|
206
|
+
text({ text }: Tokens.Text | Tokens.Escape | Tokens.Tag): string;
|
|
207
|
+
link({ text }: Tokens.Link): string;
|
|
208
|
+
image({ text }: Tokens.Image): string;
|
|
201
209
|
br(): string;
|
|
202
210
|
}
|
|
203
211
|
/**
|
|
@@ -390,7 +398,7 @@ export type HooksApi = Omit<_Hooks, "constructor" | "options">;
|
|
|
390
398
|
export type HooksObject = {
|
|
391
399
|
[K in keyof HooksApi]?: (...args: Parameters<HooksApi[K]>) => ReturnType<HooksApi[K]> | Promise<ReturnType<HooksApi[K]>>;
|
|
392
400
|
};
|
|
393
|
-
export type RendererApi = Omit<_Renderer, "constructor" | "options">;
|
|
401
|
+
export type RendererApi = Omit<_Renderer, "constructor" | "options" | "parser">;
|
|
394
402
|
export type RendererObject = {
|
|
395
403
|
[K in keyof RendererApi]?: (...args: Parameters<RendererApi[K]>) => ReturnType<RendererApi[K]> | false;
|
|
396
404
|
};
|
|
@@ -447,8 +455,13 @@ export interface MarkedExtension {
|
|
|
447
455
|
* The return value of the function is ignored.
|
|
448
456
|
*/
|
|
449
457
|
walkTokens?: ((token: Token) => void | Promise<void>) | undefined | null;
|
|
458
|
+
/**
|
|
459
|
+
* Use the new renderer that accepts an object instead of individual parameters.
|
|
460
|
+
* This option will be removed and default to true in the next major version.
|
|
461
|
+
*/
|
|
462
|
+
useNewRenderer?: boolean | undefined;
|
|
450
463
|
}
|
|
451
|
-
export interface MarkedOptions extends Omit<MarkedExtension, "hooks" | "renderer" | "tokenizer" | "extensions" | "walkTokens"> {
|
|
464
|
+
export interface MarkedOptions extends Omit<MarkedExtension, "useNewRenderer" | "hooks" | "renderer" | "tokenizer" | "extensions" | "walkTokens"> {
|
|
452
465
|
/**
|
|
453
466
|
* Hooks are methods that hook into some part of marked.
|
|
454
467
|
*/
|
|
@@ -562,8 +575,8 @@ declare class _Lexer {
|
|
|
562
575
|
/**
|
|
563
576
|
* Lexing
|
|
564
577
|
*/
|
|
565
|
-
blockTokens(src: string, tokens?: Token[]): Token[];
|
|
566
|
-
blockTokens(src: string, tokens?: TokensList): TokensList;
|
|
578
|
+
blockTokens(src: string, tokens?: Token[], lastParagraphClipped?: boolean): Token[];
|
|
579
|
+
blockTokens(src: string, tokens?: TokensList, lastParagraphClipped?: boolean): TokensList;
|
|
567
580
|
inline(src: string, tokens?: Token[]): Token[];
|
|
568
581
|
/**
|
|
569
582
|
* Lexing/Compiling
|