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/dist/index.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 RuleType2.blockQuote;
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 RuleType2.breakLine;
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 RuleType2.breakThematic;
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 RuleType2.codeBlock;
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 RuleType2.codeInline;
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 RuleType2.footnote;
132
+ type: typeof RuleType.footnote;
133
133
  }
134
134
  /**
135
135
  * Footnote reference node
136
136
  */
137
137
  export interface FootnoteReferenceNode {
138
- type: typeof RuleType2.footnoteReference;
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 RuleType2.frontmatter;
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 RuleType2.gfmTask;
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 RuleType2.heading;
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 RuleType2.htmlComment;
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 RuleType2.image;
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 RuleType2.link;
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 RuleType2.orderedList;
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 RuleType2.unorderedList;
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 RuleType2.paragraph;
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 RuleType2.ref;
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 RuleType2.refCollection;
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 RuleType2.table;
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 RuleType2.text;
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 RuleType2.textFormatted;
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 RuleType2.htmlBlock;
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 RuleType2.htmlSelfClosing;
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 RuleType2: typeof RuleTypeConst;
506
- type RuleType2 = RuleTypeValue;
505
+ declare const RuleType: typeof RuleTypeConst;
506
+ type RuleType = RuleTypeValue;
507
507
  /**
508
508
  * Main parser entry point - matches original parser interface
509
509
  */
@@ -551,4 +551,4 @@ declare const Markdown: React2.FC<Omit<React2.HTMLAttributes<Element>, "children
551
551
  declare var Markdown2: typeof Markdown;
552
552
  /** @deprecated Use the `markdown-to-jsx/react` import instead */
553
553
  declare var compiler2: typeof compiler;
554
- export { slugify, sanitizer, parser, Markdown as default, compiler2 as compiler, RuleType2 as RuleType, MarkdownToJSX, Markdown2 as Markdown };
554
+ export { slugify, sanitizer, parser, Markdown as default, compiler2 as compiler, RuleType, MarkdownToJSX, Markdown2 as Markdown };
package/dist/index.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 RuleType2.blockQuote;
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 RuleType2.breakLine;
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 RuleType2.breakThematic;
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 RuleType2.codeBlock;
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 RuleType2.codeInline;
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 RuleType2.footnote;
132
+ type: typeof RuleType.footnote;
133
133
  }
134
134
  /**
135
135
  * Footnote reference node
136
136
  */
137
137
  export interface FootnoteReferenceNode {
138
- type: typeof RuleType2.footnoteReference;
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 RuleType2.frontmatter;
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 RuleType2.gfmTask;
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 RuleType2.heading;
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 RuleType2.htmlComment;
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 RuleType2.image;
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 RuleType2.link;
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 RuleType2.orderedList;
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 RuleType2.unorderedList;
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 RuleType2.paragraph;
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 RuleType2.ref;
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 RuleType2.refCollection;
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 RuleType2.table;
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 RuleType2.text;
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 RuleType2.textFormatted;
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 RuleType2.htmlBlock;
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 RuleType2.htmlSelfClosing;
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 RuleType2: typeof RuleTypeConst;
506
- type RuleType2 = RuleTypeValue;
505
+ declare const RuleType: typeof RuleTypeConst;
506
+ type RuleType = RuleTypeValue;
507
507
  /**
508
508
  * Main parser entry point - matches original parser interface
509
509
  */
@@ -551,4 +551,4 @@ declare const Markdown: React2.FC<Omit<React2.HTMLAttributes<Element>, "children
551
551
  declare var Markdown2: typeof Markdown;
552
552
  /** @deprecated Use the `markdown-to-jsx/react` import instead */
553
553
  declare var compiler2: typeof compiler;
554
- export { slugify, sanitizer, parser, Markdown as default, compiler2 as compiler, RuleType2 as RuleType, MarkdownToJSX, Markdown2 as Markdown };
554
+ export { slugify, sanitizer, parser, Markdown as default, compiler2 as compiler, RuleType, MarkdownToJSX, Markdown2 as Markdown };