markdown-to-jsx 9.7.16 → 9.8.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/README.md +15 -3
- package/dist/html.cjs +40 -40
- package/dist/html.d.cts +26 -26
- package/dist/html.d.ts +26 -26
- package/dist/html.js +40 -40
- package/dist/html.js.map +5 -5
- package/dist/index.cjs +35 -35
- package/dist/index.d.cts +26 -26
- package/dist/index.d.ts +26 -26
- package/dist/index.js +36 -36
- package/dist/index.js.map +5 -5
- package/dist/markdown.cjs +51 -51
- package/dist/markdown.js +51 -51
- package/dist/markdown.js.map +5 -5
- package/dist/native.cjs +39 -39
- package/dist/native.d.cts +80 -29
- package/dist/native.d.ts +80 -29
- package/dist/native.js +39 -39
- package/dist/native.js.map +5 -5
- package/dist/react.cjs +35 -35
- package/dist/react.d.cts +26 -26
- package/dist/react.d.ts +26 -26
- package/dist/react.js +36 -36
- package/dist/react.js.map +5 -5
- package/dist/solid.cjs +33 -33
- package/dist/solid.d.cts +26 -26
- package/dist/solid.d.ts +26 -26
- package/dist/solid.js +35 -35
- package/dist/solid.js.map +7 -7
- package/dist/vue.cjs +32 -32
- package/dist/vue.d.cts +26 -26
- package/dist/vue.d.ts +26 -26
- package/dist/vue.js +32 -32
- package/dist/vue.js.map +7 -7
- package/package.json +1 -1
package/dist/solid.d.cts
CHANGED
|
@@ -91,25 +91,25 @@ type RequireAtLeastOne<
|
|
|
91
91
|
alert?: string;
|
|
92
92
|
/** Child nodes within the blockquote */
|
|
93
93
|
children: MarkdownToJSX.ASTNode[];
|
|
94
|
-
type: typeof
|
|
94
|
+
type: typeof RuleType.blockQuote;
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
97
|
* Hard line break node
|
|
98
98
|
*/
|
|
99
99
|
export interface BreakLineNode {
|
|
100
|
-
type: typeof
|
|
100
|
+
type: typeof RuleType.breakLine;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* Thematic break (horizontal rule) node
|
|
104
104
|
*/
|
|
105
105
|
export interface BreakThematicNode {
|
|
106
|
-
type: typeof
|
|
106
|
+
type: typeof RuleType.breakThematic;
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Code block node (fenced code blocks)
|
|
110
110
|
*/
|
|
111
111
|
export interface CodeBlockNode {
|
|
112
|
-
type: typeof
|
|
112
|
+
type: typeof RuleType.codeBlock;
|
|
113
113
|
/** HTML attributes for the code block */
|
|
114
114
|
attrs?: React.JSX.IntrinsicAttributes;
|
|
115
115
|
/** Programming language identifier */
|
|
@@ -121,7 +121,7 @@ type RequireAtLeastOne<
|
|
|
121
121
|
* Inline code node
|
|
122
122
|
*/
|
|
123
123
|
export interface CodeInlineNode {
|
|
124
|
-
type: typeof
|
|
124
|
+
type: typeof RuleType.codeInline;
|
|
125
125
|
/** Code text */
|
|
126
126
|
text: string;
|
|
127
127
|
}
|
|
@@ -129,13 +129,13 @@ type RequireAtLeastOne<
|
|
|
129
129
|
* Footnote definition node (not rendered, stored in refCollection)
|
|
130
130
|
*/
|
|
131
131
|
export interface FootnoteNode {
|
|
132
|
-
type: typeof
|
|
132
|
+
type: typeof RuleType.footnote;
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
135
|
* Footnote reference node
|
|
136
136
|
*/
|
|
137
137
|
export interface FootnoteReferenceNode {
|
|
138
|
-
type: typeof
|
|
138
|
+
type: typeof RuleType.footnoteReference;
|
|
139
139
|
/** Link target (anchor) */
|
|
140
140
|
target: string;
|
|
141
141
|
/** Display text */
|
|
@@ -145,7 +145,7 @@ type RequireAtLeastOne<
|
|
|
145
145
|
* YAML frontmatter node
|
|
146
146
|
*/
|
|
147
147
|
export interface FrontmatterNode {
|
|
148
|
-
type: typeof
|
|
148
|
+
type: typeof RuleType.frontmatter;
|
|
149
149
|
/** Frontmatter content */
|
|
150
150
|
text: string;
|
|
151
151
|
}
|
|
@@ -153,7 +153,7 @@ type RequireAtLeastOne<
|
|
|
153
153
|
* GFM task list item node
|
|
154
154
|
*/
|
|
155
155
|
export interface GFMTaskNode {
|
|
156
|
-
type: typeof
|
|
156
|
+
type: typeof RuleType.gfmTask;
|
|
157
157
|
/** Whether the task is completed */
|
|
158
158
|
completed: boolean;
|
|
159
159
|
}
|
|
@@ -161,7 +161,7 @@ type RequireAtLeastOne<
|
|
|
161
161
|
* Heading node
|
|
162
162
|
*/
|
|
163
163
|
export interface HeadingNode {
|
|
164
|
-
type: typeof
|
|
164
|
+
type: typeof RuleType.heading;
|
|
165
165
|
/** Child nodes (text content) */
|
|
166
166
|
children: MarkdownToJSX.ASTNode[];
|
|
167
167
|
/** Generated HTML ID for anchor linking */
|
|
@@ -173,7 +173,7 @@ type RequireAtLeastOne<
|
|
|
173
173
|
* HTML comment node
|
|
174
174
|
*/
|
|
175
175
|
export interface HTMLCommentNode {
|
|
176
|
-
type: typeof
|
|
176
|
+
type: typeof RuleType.htmlComment;
|
|
177
177
|
/** Comment text */
|
|
178
178
|
text: string;
|
|
179
179
|
}
|
|
@@ -181,7 +181,7 @@ type RequireAtLeastOne<
|
|
|
181
181
|
* Image node
|
|
182
182
|
*/
|
|
183
183
|
export interface ImageNode {
|
|
184
|
-
type: typeof
|
|
184
|
+
type: typeof RuleType.image;
|
|
185
185
|
/** Alt text */
|
|
186
186
|
alt?: string;
|
|
187
187
|
/** Image URL */
|
|
@@ -193,7 +193,7 @@ type RequireAtLeastOne<
|
|
|
193
193
|
* Link node
|
|
194
194
|
*/
|
|
195
195
|
export interface LinkNode {
|
|
196
|
-
type: typeof
|
|
196
|
+
type: typeof RuleType.link;
|
|
197
197
|
/** Child nodes (link text) */
|
|
198
198
|
children: MarkdownToJSX.ASTNode[];
|
|
199
199
|
/** Link URL (null for reference links without definition) */
|
|
@@ -205,7 +205,7 @@ type RequireAtLeastOne<
|
|
|
205
205
|
* Ordered list node
|
|
206
206
|
*/
|
|
207
207
|
export interface OrderedListNode {
|
|
208
|
-
type: typeof
|
|
208
|
+
type: typeof RuleType.orderedList;
|
|
209
209
|
/** Array of list items, each item is an array of nodes */
|
|
210
210
|
items: MarkdownToJSX.ASTNode[][];
|
|
211
211
|
/** Starting number for the list */
|
|
@@ -215,7 +215,7 @@ type RequireAtLeastOne<
|
|
|
215
215
|
* Unordered list node
|
|
216
216
|
*/
|
|
217
217
|
export interface UnorderedListNode {
|
|
218
|
-
type: typeof
|
|
218
|
+
type: typeof RuleType.unorderedList;
|
|
219
219
|
/** Array of list items, each item is an array of nodes */
|
|
220
220
|
items: MarkdownToJSX.ASTNode[][];
|
|
221
221
|
}
|
|
@@ -223,7 +223,7 @@ type RequireAtLeastOne<
|
|
|
223
223
|
* Paragraph node
|
|
224
224
|
*/
|
|
225
225
|
export interface ParagraphNode {
|
|
226
|
-
type: typeof
|
|
226
|
+
type: typeof RuleType.paragraph;
|
|
227
227
|
/** Child nodes */
|
|
228
228
|
children: MarkdownToJSX.ASTNode[];
|
|
229
229
|
}
|
|
@@ -231,13 +231,13 @@ type RequireAtLeastOne<
|
|
|
231
231
|
* Reference definition node (not rendered, stored in refCollection)
|
|
232
232
|
*/
|
|
233
233
|
export interface ReferenceNode {
|
|
234
|
-
type: typeof
|
|
234
|
+
type: typeof RuleType.ref;
|
|
235
235
|
}
|
|
236
236
|
/**
|
|
237
237
|
* Reference collection node (appears at AST root, includes footnotes with '^' prefix)
|
|
238
238
|
*/
|
|
239
239
|
export interface ReferenceCollectionNode {
|
|
240
|
-
type: typeof
|
|
240
|
+
type: typeof RuleType.refCollection;
|
|
241
241
|
/** Map of reference labels to their definitions */
|
|
242
242
|
refs: {
|
|
243
243
|
[key: string]: {
|
|
@@ -250,7 +250,7 @@ type RequireAtLeastOne<
|
|
|
250
250
|
* Table node
|
|
251
251
|
*/
|
|
252
252
|
export interface TableNode {
|
|
253
|
-
type: typeof
|
|
253
|
+
type: typeof RuleType.table;
|
|
254
254
|
/**
|
|
255
255
|
* alignment for each table column
|
|
256
256
|
*/
|
|
@@ -264,7 +264,7 @@ type RequireAtLeastOne<
|
|
|
264
264
|
* Plain text node
|
|
265
265
|
*/
|
|
266
266
|
export interface TextNode {
|
|
267
|
-
type: typeof
|
|
267
|
+
type: typeof RuleType.text;
|
|
268
268
|
/** Text content */
|
|
269
269
|
text: string;
|
|
270
270
|
}
|
|
@@ -272,7 +272,7 @@ type RequireAtLeastOne<
|
|
|
272
272
|
* Formatted text node (bold, italic, etc.)
|
|
273
273
|
*/
|
|
274
274
|
export interface FormattedTextNode {
|
|
275
|
-
type: typeof
|
|
275
|
+
type: typeof RuleType.textFormatted;
|
|
276
276
|
/**
|
|
277
277
|
* the corresponding html tag
|
|
278
278
|
*/
|
|
@@ -286,7 +286,7 @@ type RequireAtLeastOne<
|
|
|
286
286
|
* HTML block node (includes JSX components)
|
|
287
287
|
*/
|
|
288
288
|
export interface HTMLNode {
|
|
289
|
-
type: typeof
|
|
289
|
+
type: typeof RuleType.htmlBlock;
|
|
290
290
|
/** Parsed HTML attributes */
|
|
291
291
|
attrs?: Record<string, any>;
|
|
292
292
|
/** Parsed child nodes (always parsed, even for verbatim blocks) */
|
|
@@ -308,7 +308,7 @@ type RequireAtLeastOne<
|
|
|
308
308
|
* Self-closing HTML tag node
|
|
309
309
|
*/
|
|
310
310
|
export interface HTMLSelfClosingNode {
|
|
311
|
-
type: typeof
|
|
311
|
+
type: typeof RuleType.htmlSelfClosing;
|
|
312
312
|
/** Parsed HTML attributes */
|
|
313
313
|
attrs?: Record<string, any>;
|
|
314
314
|
/** @internal Whether this is a closing tag */
|
|
@@ -502,8 +502,8 @@ type RequireAtLeastOne<
|
|
|
502
502
|
optimizeForStreaming?: boolean;
|
|
503
503
|
}>;
|
|
504
504
|
}
|
|
505
|
-
declare const
|
|
506
|
-
type
|
|
505
|
+
declare const RuleType: typeof RuleTypeConst;
|
|
506
|
+
type RuleType = RuleTypeValue;
|
|
507
507
|
type RequireAtLeastOne<
|
|
508
508
|
T,
|
|
509
509
|
Keys extends keyof T = keyof T
|
|
@@ -601,4 +601,4 @@ declare const Markdown: Component<Omit<JSX2.HTMLAttributes<HTMLElement>, "childr
|
|
|
601
601
|
children?: string | Accessor<string> | null;
|
|
602
602
|
options?: SolidOptions;
|
|
603
603
|
}>;
|
|
604
|
-
export { slugify, sanitizer, parser, Markdown as default, compiler, astToJSX, SolidOverrides, SolidOverride, SolidOptions,
|
|
604
|
+
export { slugify, sanitizer, parser, Markdown as default, compiler, astToJSX, SolidOverrides, SolidOverride, SolidOptions, RuleType, MarkdownToJSX, MarkdownProvider, MarkdownContext, Markdown };
|
package/dist/solid.d.ts
CHANGED
|
@@ -91,25 +91,25 @@ type RequireAtLeastOne<
|
|
|
91
91
|
alert?: string;
|
|
92
92
|
/** Child nodes within the blockquote */
|
|
93
93
|
children: MarkdownToJSX.ASTNode[];
|
|
94
|
-
type: typeof
|
|
94
|
+
type: typeof RuleType.blockQuote;
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
97
|
* Hard line break node
|
|
98
98
|
*/
|
|
99
99
|
export interface BreakLineNode {
|
|
100
|
-
type: typeof
|
|
100
|
+
type: typeof RuleType.breakLine;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* Thematic break (horizontal rule) node
|
|
104
104
|
*/
|
|
105
105
|
export interface BreakThematicNode {
|
|
106
|
-
type: typeof
|
|
106
|
+
type: typeof RuleType.breakThematic;
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Code block node (fenced code blocks)
|
|
110
110
|
*/
|
|
111
111
|
export interface CodeBlockNode {
|
|
112
|
-
type: typeof
|
|
112
|
+
type: typeof RuleType.codeBlock;
|
|
113
113
|
/** HTML attributes for the code block */
|
|
114
114
|
attrs?: React.JSX.IntrinsicAttributes;
|
|
115
115
|
/** Programming language identifier */
|
|
@@ -121,7 +121,7 @@ type RequireAtLeastOne<
|
|
|
121
121
|
* Inline code node
|
|
122
122
|
*/
|
|
123
123
|
export interface CodeInlineNode {
|
|
124
|
-
type: typeof
|
|
124
|
+
type: typeof RuleType.codeInline;
|
|
125
125
|
/** Code text */
|
|
126
126
|
text: string;
|
|
127
127
|
}
|
|
@@ -129,13 +129,13 @@ type RequireAtLeastOne<
|
|
|
129
129
|
* Footnote definition node (not rendered, stored in refCollection)
|
|
130
130
|
*/
|
|
131
131
|
export interface FootnoteNode {
|
|
132
|
-
type: typeof
|
|
132
|
+
type: typeof RuleType.footnote;
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
135
|
* Footnote reference node
|
|
136
136
|
*/
|
|
137
137
|
export interface FootnoteReferenceNode {
|
|
138
|
-
type: typeof
|
|
138
|
+
type: typeof RuleType.footnoteReference;
|
|
139
139
|
/** Link target (anchor) */
|
|
140
140
|
target: string;
|
|
141
141
|
/** Display text */
|
|
@@ -145,7 +145,7 @@ type RequireAtLeastOne<
|
|
|
145
145
|
* YAML frontmatter node
|
|
146
146
|
*/
|
|
147
147
|
export interface FrontmatterNode {
|
|
148
|
-
type: typeof
|
|
148
|
+
type: typeof RuleType.frontmatter;
|
|
149
149
|
/** Frontmatter content */
|
|
150
150
|
text: string;
|
|
151
151
|
}
|
|
@@ -153,7 +153,7 @@ type RequireAtLeastOne<
|
|
|
153
153
|
* GFM task list item node
|
|
154
154
|
*/
|
|
155
155
|
export interface GFMTaskNode {
|
|
156
|
-
type: typeof
|
|
156
|
+
type: typeof RuleType.gfmTask;
|
|
157
157
|
/** Whether the task is completed */
|
|
158
158
|
completed: boolean;
|
|
159
159
|
}
|
|
@@ -161,7 +161,7 @@ type RequireAtLeastOne<
|
|
|
161
161
|
* Heading node
|
|
162
162
|
*/
|
|
163
163
|
export interface HeadingNode {
|
|
164
|
-
type: typeof
|
|
164
|
+
type: typeof RuleType.heading;
|
|
165
165
|
/** Child nodes (text content) */
|
|
166
166
|
children: MarkdownToJSX.ASTNode[];
|
|
167
167
|
/** Generated HTML ID for anchor linking */
|
|
@@ -173,7 +173,7 @@ type RequireAtLeastOne<
|
|
|
173
173
|
* HTML comment node
|
|
174
174
|
*/
|
|
175
175
|
export interface HTMLCommentNode {
|
|
176
|
-
type: typeof
|
|
176
|
+
type: typeof RuleType.htmlComment;
|
|
177
177
|
/** Comment text */
|
|
178
178
|
text: string;
|
|
179
179
|
}
|
|
@@ -181,7 +181,7 @@ type RequireAtLeastOne<
|
|
|
181
181
|
* Image node
|
|
182
182
|
*/
|
|
183
183
|
export interface ImageNode {
|
|
184
|
-
type: typeof
|
|
184
|
+
type: typeof RuleType.image;
|
|
185
185
|
/** Alt text */
|
|
186
186
|
alt?: string;
|
|
187
187
|
/** Image URL */
|
|
@@ -193,7 +193,7 @@ type RequireAtLeastOne<
|
|
|
193
193
|
* Link node
|
|
194
194
|
*/
|
|
195
195
|
export interface LinkNode {
|
|
196
|
-
type: typeof
|
|
196
|
+
type: typeof RuleType.link;
|
|
197
197
|
/** Child nodes (link text) */
|
|
198
198
|
children: MarkdownToJSX.ASTNode[];
|
|
199
199
|
/** Link URL (null for reference links without definition) */
|
|
@@ -205,7 +205,7 @@ type RequireAtLeastOne<
|
|
|
205
205
|
* Ordered list node
|
|
206
206
|
*/
|
|
207
207
|
export interface OrderedListNode {
|
|
208
|
-
type: typeof
|
|
208
|
+
type: typeof RuleType.orderedList;
|
|
209
209
|
/** Array of list items, each item is an array of nodes */
|
|
210
210
|
items: MarkdownToJSX.ASTNode[][];
|
|
211
211
|
/** Starting number for the list */
|
|
@@ -215,7 +215,7 @@ type RequireAtLeastOne<
|
|
|
215
215
|
* Unordered list node
|
|
216
216
|
*/
|
|
217
217
|
export interface UnorderedListNode {
|
|
218
|
-
type: typeof
|
|
218
|
+
type: typeof RuleType.unorderedList;
|
|
219
219
|
/** Array of list items, each item is an array of nodes */
|
|
220
220
|
items: MarkdownToJSX.ASTNode[][];
|
|
221
221
|
}
|
|
@@ -223,7 +223,7 @@ type RequireAtLeastOne<
|
|
|
223
223
|
* Paragraph node
|
|
224
224
|
*/
|
|
225
225
|
export interface ParagraphNode {
|
|
226
|
-
type: typeof
|
|
226
|
+
type: typeof RuleType.paragraph;
|
|
227
227
|
/** Child nodes */
|
|
228
228
|
children: MarkdownToJSX.ASTNode[];
|
|
229
229
|
}
|
|
@@ -231,13 +231,13 @@ type RequireAtLeastOne<
|
|
|
231
231
|
* Reference definition node (not rendered, stored in refCollection)
|
|
232
232
|
*/
|
|
233
233
|
export interface ReferenceNode {
|
|
234
|
-
type: typeof
|
|
234
|
+
type: typeof RuleType.ref;
|
|
235
235
|
}
|
|
236
236
|
/**
|
|
237
237
|
* Reference collection node (appears at AST root, includes footnotes with '^' prefix)
|
|
238
238
|
*/
|
|
239
239
|
export interface ReferenceCollectionNode {
|
|
240
|
-
type: typeof
|
|
240
|
+
type: typeof RuleType.refCollection;
|
|
241
241
|
/** Map of reference labels to their definitions */
|
|
242
242
|
refs: {
|
|
243
243
|
[key: string]: {
|
|
@@ -250,7 +250,7 @@ type RequireAtLeastOne<
|
|
|
250
250
|
* Table node
|
|
251
251
|
*/
|
|
252
252
|
export interface TableNode {
|
|
253
|
-
type: typeof
|
|
253
|
+
type: typeof RuleType.table;
|
|
254
254
|
/**
|
|
255
255
|
* alignment for each table column
|
|
256
256
|
*/
|
|
@@ -264,7 +264,7 @@ type RequireAtLeastOne<
|
|
|
264
264
|
* Plain text node
|
|
265
265
|
*/
|
|
266
266
|
export interface TextNode {
|
|
267
|
-
type: typeof
|
|
267
|
+
type: typeof RuleType.text;
|
|
268
268
|
/** Text content */
|
|
269
269
|
text: string;
|
|
270
270
|
}
|
|
@@ -272,7 +272,7 @@ type RequireAtLeastOne<
|
|
|
272
272
|
* Formatted text node (bold, italic, etc.)
|
|
273
273
|
*/
|
|
274
274
|
export interface FormattedTextNode {
|
|
275
|
-
type: typeof
|
|
275
|
+
type: typeof RuleType.textFormatted;
|
|
276
276
|
/**
|
|
277
277
|
* the corresponding html tag
|
|
278
278
|
*/
|
|
@@ -286,7 +286,7 @@ type RequireAtLeastOne<
|
|
|
286
286
|
* HTML block node (includes JSX components)
|
|
287
287
|
*/
|
|
288
288
|
export interface HTMLNode {
|
|
289
|
-
type: typeof
|
|
289
|
+
type: typeof RuleType.htmlBlock;
|
|
290
290
|
/** Parsed HTML attributes */
|
|
291
291
|
attrs?: Record<string, any>;
|
|
292
292
|
/** Parsed child nodes (always parsed, even for verbatim blocks) */
|
|
@@ -308,7 +308,7 @@ type RequireAtLeastOne<
|
|
|
308
308
|
* Self-closing HTML tag node
|
|
309
309
|
*/
|
|
310
310
|
export interface HTMLSelfClosingNode {
|
|
311
|
-
type: typeof
|
|
311
|
+
type: typeof RuleType.htmlSelfClosing;
|
|
312
312
|
/** Parsed HTML attributes */
|
|
313
313
|
attrs?: Record<string, any>;
|
|
314
314
|
/** @internal Whether this is a closing tag */
|
|
@@ -502,8 +502,8 @@ type RequireAtLeastOne<
|
|
|
502
502
|
optimizeForStreaming?: boolean;
|
|
503
503
|
}>;
|
|
504
504
|
}
|
|
505
|
-
declare const
|
|
506
|
-
type
|
|
505
|
+
declare const RuleType: typeof RuleTypeConst;
|
|
506
|
+
type RuleType = RuleTypeValue;
|
|
507
507
|
type RequireAtLeastOne<
|
|
508
508
|
T,
|
|
509
509
|
Keys extends keyof T = keyof T
|
|
@@ -601,4 +601,4 @@ declare const Markdown: Component<Omit<JSX2.HTMLAttributes<HTMLElement>, "childr
|
|
|
601
601
|
children?: string | Accessor<string> | null;
|
|
602
602
|
options?: SolidOptions;
|
|
603
603
|
}>;
|
|
604
|
-
export { slugify, sanitizer, parser, Markdown as default, compiler, astToJSX, SolidOverrides, SolidOverride, SolidOptions,
|
|
604
|
+
export { slugify, sanitizer, parser, Markdown as default, compiler, astToJSX, SolidOverrides, SolidOverride, SolidOptions, RuleType, MarkdownToJSX, MarkdownProvider, MarkdownContext, Markdown };
|