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/html.d.cts CHANGED
@@ -90,25 +90,25 @@ type RequireAtLeastOne<
90
90
  alert?: string;
91
91
  /** Child nodes within the blockquote */
92
92
  children: MarkdownToJSX.ASTNode[];
93
- type: typeof RuleType2.blockQuote;
93
+ type: typeof RuleType.blockQuote;
94
94
  }
95
95
  /**
96
96
  * Hard line break node
97
97
  */
98
98
  export interface BreakLineNode {
99
- type: typeof RuleType2.breakLine;
99
+ type: typeof RuleType.breakLine;
100
100
  }
101
101
  /**
102
102
  * Thematic break (horizontal rule) node
103
103
  */
104
104
  export interface BreakThematicNode {
105
- type: typeof RuleType2.breakThematic;
105
+ type: typeof RuleType.breakThematic;
106
106
  }
107
107
  /**
108
108
  * Code block node (fenced code blocks)
109
109
  */
110
110
  export interface CodeBlockNode {
111
- type: typeof RuleType2.codeBlock;
111
+ type: typeof RuleType.codeBlock;
112
112
  /** HTML attributes for the code block */
113
113
  attrs?: React.JSX.IntrinsicAttributes;
114
114
  /** Programming language identifier */
@@ -120,7 +120,7 @@ type RequireAtLeastOne<
120
120
  * Inline code node
121
121
  */
122
122
  export interface CodeInlineNode {
123
- type: typeof RuleType2.codeInline;
123
+ type: typeof RuleType.codeInline;
124
124
  /** Code text */
125
125
  text: string;
126
126
  }
@@ -128,13 +128,13 @@ type RequireAtLeastOne<
128
128
  * Footnote definition node (not rendered, stored in refCollection)
129
129
  */
130
130
  export interface FootnoteNode {
131
- type: typeof RuleType2.footnote;
131
+ type: typeof RuleType.footnote;
132
132
  }
133
133
  /**
134
134
  * Footnote reference node
135
135
  */
136
136
  export interface FootnoteReferenceNode {
137
- type: typeof RuleType2.footnoteReference;
137
+ type: typeof RuleType.footnoteReference;
138
138
  /** Link target (anchor) */
139
139
  target: string;
140
140
  /** Display text */
@@ -144,7 +144,7 @@ type RequireAtLeastOne<
144
144
  * YAML frontmatter node
145
145
  */
146
146
  export interface FrontmatterNode {
147
- type: typeof RuleType2.frontmatter;
147
+ type: typeof RuleType.frontmatter;
148
148
  /** Frontmatter content */
149
149
  text: string;
150
150
  }
@@ -152,7 +152,7 @@ type RequireAtLeastOne<
152
152
  * GFM task list item node
153
153
  */
154
154
  export interface GFMTaskNode {
155
- type: typeof RuleType2.gfmTask;
155
+ type: typeof RuleType.gfmTask;
156
156
  /** Whether the task is completed */
157
157
  completed: boolean;
158
158
  }
@@ -160,7 +160,7 @@ type RequireAtLeastOne<
160
160
  * Heading node
161
161
  */
162
162
  export interface HeadingNode {
163
- type: typeof RuleType2.heading;
163
+ type: typeof RuleType.heading;
164
164
  /** Child nodes (text content) */
165
165
  children: MarkdownToJSX.ASTNode[];
166
166
  /** Generated HTML ID for anchor linking */
@@ -172,7 +172,7 @@ type RequireAtLeastOne<
172
172
  * HTML comment node
173
173
  */
174
174
  export interface HTMLCommentNode {
175
- type: typeof RuleType2.htmlComment;
175
+ type: typeof RuleType.htmlComment;
176
176
  /** Comment text */
177
177
  text: string;
178
178
  }
@@ -180,7 +180,7 @@ type RequireAtLeastOne<
180
180
  * Image node
181
181
  */
182
182
  export interface ImageNode {
183
- type: typeof RuleType2.image;
183
+ type: typeof RuleType.image;
184
184
  /** Alt text */
185
185
  alt?: string;
186
186
  /** Image URL */
@@ -192,7 +192,7 @@ type RequireAtLeastOne<
192
192
  * Link node
193
193
  */
194
194
  export interface LinkNode {
195
- type: typeof RuleType2.link;
195
+ type: typeof RuleType.link;
196
196
  /** Child nodes (link text) */
197
197
  children: MarkdownToJSX.ASTNode[];
198
198
  /** Link URL (null for reference links without definition) */
@@ -204,7 +204,7 @@ type RequireAtLeastOne<
204
204
  * Ordered list node
205
205
  */
206
206
  export interface OrderedListNode {
207
- type: typeof RuleType2.orderedList;
207
+ type: typeof RuleType.orderedList;
208
208
  /** Array of list items, each item is an array of nodes */
209
209
  items: MarkdownToJSX.ASTNode[][];
210
210
  /** Starting number for the list */
@@ -214,7 +214,7 @@ type RequireAtLeastOne<
214
214
  * Unordered list node
215
215
  */
216
216
  export interface UnorderedListNode {
217
- type: typeof RuleType2.unorderedList;
217
+ type: typeof RuleType.unorderedList;
218
218
  /** Array of list items, each item is an array of nodes */
219
219
  items: MarkdownToJSX.ASTNode[][];
220
220
  }
@@ -222,7 +222,7 @@ type RequireAtLeastOne<
222
222
  * Paragraph node
223
223
  */
224
224
  export interface ParagraphNode {
225
- type: typeof RuleType2.paragraph;
225
+ type: typeof RuleType.paragraph;
226
226
  /** Child nodes */
227
227
  children: MarkdownToJSX.ASTNode[];
228
228
  }
@@ -230,13 +230,13 @@ type RequireAtLeastOne<
230
230
  * Reference definition node (not rendered, stored in refCollection)
231
231
  */
232
232
  export interface ReferenceNode {
233
- type: typeof RuleType2.ref;
233
+ type: typeof RuleType.ref;
234
234
  }
235
235
  /**
236
236
  * Reference collection node (appears at AST root, includes footnotes with '^' prefix)
237
237
  */
238
238
  export interface ReferenceCollectionNode {
239
- type: typeof RuleType2.refCollection;
239
+ type: typeof RuleType.refCollection;
240
240
  /** Map of reference labels to their definitions */
241
241
  refs: {
242
242
  [key: string]: {
@@ -249,7 +249,7 @@ type RequireAtLeastOne<
249
249
  * Table node
250
250
  */
251
251
  export interface TableNode {
252
- type: typeof RuleType2.table;
252
+ type: typeof RuleType.table;
253
253
  /**
254
254
  * alignment for each table column
255
255
  */
@@ -263,7 +263,7 @@ type RequireAtLeastOne<
263
263
  * Plain text node
264
264
  */
265
265
  export interface TextNode {
266
- type: typeof RuleType2.text;
266
+ type: typeof RuleType.text;
267
267
  /** Text content */
268
268
  text: string;
269
269
  }
@@ -271,7 +271,7 @@ type RequireAtLeastOne<
271
271
  * Formatted text node (bold, italic, etc.)
272
272
  */
273
273
  export interface FormattedTextNode {
274
- type: typeof RuleType2.textFormatted;
274
+ type: typeof RuleType.textFormatted;
275
275
  /**
276
276
  * the corresponding html tag
277
277
  */
@@ -285,7 +285,7 @@ type RequireAtLeastOne<
285
285
  * HTML block node (includes JSX components)
286
286
  */
287
287
  export interface HTMLNode {
288
- type: typeof RuleType2.htmlBlock;
288
+ type: typeof RuleType.htmlBlock;
289
289
  /** Parsed HTML attributes */
290
290
  attrs?: Record<string, any>;
291
291
  /** Parsed child nodes (always parsed, even for verbatim blocks) */
@@ -307,7 +307,7 @@ type RequireAtLeastOne<
307
307
  * Self-closing HTML tag node
308
308
  */
309
309
  export interface HTMLSelfClosingNode {
310
- type: typeof RuleType2.htmlSelfClosing;
310
+ type: typeof RuleType.htmlSelfClosing;
311
311
  /** Parsed HTML attributes */
312
312
  attrs?: Record<string, any>;
313
313
  /** @internal Whether this is a closing tag */
@@ -501,8 +501,8 @@ type RequireAtLeastOne<
501
501
  optimizeForStreaming?: boolean;
502
502
  }>;
503
503
  }
504
- declare const RuleType2: typeof RuleTypeConst;
505
- type RuleType2 = RuleTypeValue;
504
+ declare const RuleType: typeof RuleTypeConst;
505
+ type RuleType = RuleTypeValue;
506
506
  /**
507
507
  * Main parser entry point - matches original parser interface
508
508
  */
@@ -576,4 +576,4 @@ declare function astToHTML(nodes: MarkdownToJSX.ASTNode[], options?: HTMLOptions
576
576
  * @returns HTML string
577
577
  */
578
578
  declare function compiler(markdown: string, options?: HTMLOptions): string;
579
- export { slugify, sanitizer, parser, compiler, astToHTML, RuleType2 as RuleType, MarkdownToJSX, HTMLOverrides, HTMLOverride, HTMLOptions };
579
+ export { slugify, sanitizer, parser, compiler, astToHTML, RuleType, MarkdownToJSX, HTMLOverrides, HTMLOverride, HTMLOptions };
package/dist/html.d.ts CHANGED
@@ -90,25 +90,25 @@ type RequireAtLeastOne<
90
90
  alert?: string;
91
91
  /** Child nodes within the blockquote */
92
92
  children: MarkdownToJSX.ASTNode[];
93
- type: typeof RuleType2.blockQuote;
93
+ type: typeof RuleType.blockQuote;
94
94
  }
95
95
  /**
96
96
  * Hard line break node
97
97
  */
98
98
  export interface BreakLineNode {
99
- type: typeof RuleType2.breakLine;
99
+ type: typeof RuleType.breakLine;
100
100
  }
101
101
  /**
102
102
  * Thematic break (horizontal rule) node
103
103
  */
104
104
  export interface BreakThematicNode {
105
- type: typeof RuleType2.breakThematic;
105
+ type: typeof RuleType.breakThematic;
106
106
  }
107
107
  /**
108
108
  * Code block node (fenced code blocks)
109
109
  */
110
110
  export interface CodeBlockNode {
111
- type: typeof RuleType2.codeBlock;
111
+ type: typeof RuleType.codeBlock;
112
112
  /** HTML attributes for the code block */
113
113
  attrs?: React.JSX.IntrinsicAttributes;
114
114
  /** Programming language identifier */
@@ -120,7 +120,7 @@ type RequireAtLeastOne<
120
120
  * Inline code node
121
121
  */
122
122
  export interface CodeInlineNode {
123
- type: typeof RuleType2.codeInline;
123
+ type: typeof RuleType.codeInline;
124
124
  /** Code text */
125
125
  text: string;
126
126
  }
@@ -128,13 +128,13 @@ type RequireAtLeastOne<
128
128
  * Footnote definition node (not rendered, stored in refCollection)
129
129
  */
130
130
  export interface FootnoteNode {
131
- type: typeof RuleType2.footnote;
131
+ type: typeof RuleType.footnote;
132
132
  }
133
133
  /**
134
134
  * Footnote reference node
135
135
  */
136
136
  export interface FootnoteReferenceNode {
137
- type: typeof RuleType2.footnoteReference;
137
+ type: typeof RuleType.footnoteReference;
138
138
  /** Link target (anchor) */
139
139
  target: string;
140
140
  /** Display text */
@@ -144,7 +144,7 @@ type RequireAtLeastOne<
144
144
  * YAML frontmatter node
145
145
  */
146
146
  export interface FrontmatterNode {
147
- type: typeof RuleType2.frontmatter;
147
+ type: typeof RuleType.frontmatter;
148
148
  /** Frontmatter content */
149
149
  text: string;
150
150
  }
@@ -152,7 +152,7 @@ type RequireAtLeastOne<
152
152
  * GFM task list item node
153
153
  */
154
154
  export interface GFMTaskNode {
155
- type: typeof RuleType2.gfmTask;
155
+ type: typeof RuleType.gfmTask;
156
156
  /** Whether the task is completed */
157
157
  completed: boolean;
158
158
  }
@@ -160,7 +160,7 @@ type RequireAtLeastOne<
160
160
  * Heading node
161
161
  */
162
162
  export interface HeadingNode {
163
- type: typeof RuleType2.heading;
163
+ type: typeof RuleType.heading;
164
164
  /** Child nodes (text content) */
165
165
  children: MarkdownToJSX.ASTNode[];
166
166
  /** Generated HTML ID for anchor linking */
@@ -172,7 +172,7 @@ type RequireAtLeastOne<
172
172
  * HTML comment node
173
173
  */
174
174
  export interface HTMLCommentNode {
175
- type: typeof RuleType2.htmlComment;
175
+ type: typeof RuleType.htmlComment;
176
176
  /** Comment text */
177
177
  text: string;
178
178
  }
@@ -180,7 +180,7 @@ type RequireAtLeastOne<
180
180
  * Image node
181
181
  */
182
182
  export interface ImageNode {
183
- type: typeof RuleType2.image;
183
+ type: typeof RuleType.image;
184
184
  /** Alt text */
185
185
  alt?: string;
186
186
  /** Image URL */
@@ -192,7 +192,7 @@ type RequireAtLeastOne<
192
192
  * Link node
193
193
  */
194
194
  export interface LinkNode {
195
- type: typeof RuleType2.link;
195
+ type: typeof RuleType.link;
196
196
  /** Child nodes (link text) */
197
197
  children: MarkdownToJSX.ASTNode[];
198
198
  /** Link URL (null for reference links without definition) */
@@ -204,7 +204,7 @@ type RequireAtLeastOne<
204
204
  * Ordered list node
205
205
  */
206
206
  export interface OrderedListNode {
207
- type: typeof RuleType2.orderedList;
207
+ type: typeof RuleType.orderedList;
208
208
  /** Array of list items, each item is an array of nodes */
209
209
  items: MarkdownToJSX.ASTNode[][];
210
210
  /** Starting number for the list */
@@ -214,7 +214,7 @@ type RequireAtLeastOne<
214
214
  * Unordered list node
215
215
  */
216
216
  export interface UnorderedListNode {
217
- type: typeof RuleType2.unorderedList;
217
+ type: typeof RuleType.unorderedList;
218
218
  /** Array of list items, each item is an array of nodes */
219
219
  items: MarkdownToJSX.ASTNode[][];
220
220
  }
@@ -222,7 +222,7 @@ type RequireAtLeastOne<
222
222
  * Paragraph node
223
223
  */
224
224
  export interface ParagraphNode {
225
- type: typeof RuleType2.paragraph;
225
+ type: typeof RuleType.paragraph;
226
226
  /** Child nodes */
227
227
  children: MarkdownToJSX.ASTNode[];
228
228
  }
@@ -230,13 +230,13 @@ type RequireAtLeastOne<
230
230
  * Reference definition node (not rendered, stored in refCollection)
231
231
  */
232
232
  export interface ReferenceNode {
233
- type: typeof RuleType2.ref;
233
+ type: typeof RuleType.ref;
234
234
  }
235
235
  /**
236
236
  * Reference collection node (appears at AST root, includes footnotes with '^' prefix)
237
237
  */
238
238
  export interface ReferenceCollectionNode {
239
- type: typeof RuleType2.refCollection;
239
+ type: typeof RuleType.refCollection;
240
240
  /** Map of reference labels to their definitions */
241
241
  refs: {
242
242
  [key: string]: {
@@ -249,7 +249,7 @@ type RequireAtLeastOne<
249
249
  * Table node
250
250
  */
251
251
  export interface TableNode {
252
- type: typeof RuleType2.table;
252
+ type: typeof RuleType.table;
253
253
  /**
254
254
  * alignment for each table column
255
255
  */
@@ -263,7 +263,7 @@ type RequireAtLeastOne<
263
263
  * Plain text node
264
264
  */
265
265
  export interface TextNode {
266
- type: typeof RuleType2.text;
266
+ type: typeof RuleType.text;
267
267
  /** Text content */
268
268
  text: string;
269
269
  }
@@ -271,7 +271,7 @@ type RequireAtLeastOne<
271
271
  * Formatted text node (bold, italic, etc.)
272
272
  */
273
273
  export interface FormattedTextNode {
274
- type: typeof RuleType2.textFormatted;
274
+ type: typeof RuleType.textFormatted;
275
275
  /**
276
276
  * the corresponding html tag
277
277
  */
@@ -285,7 +285,7 @@ type RequireAtLeastOne<
285
285
  * HTML block node (includes JSX components)
286
286
  */
287
287
  export interface HTMLNode {
288
- type: typeof RuleType2.htmlBlock;
288
+ type: typeof RuleType.htmlBlock;
289
289
  /** Parsed HTML attributes */
290
290
  attrs?: Record<string, any>;
291
291
  /** Parsed child nodes (always parsed, even for verbatim blocks) */
@@ -307,7 +307,7 @@ type RequireAtLeastOne<
307
307
  * Self-closing HTML tag node
308
308
  */
309
309
  export interface HTMLSelfClosingNode {
310
- type: typeof RuleType2.htmlSelfClosing;
310
+ type: typeof RuleType.htmlSelfClosing;
311
311
  /** Parsed HTML attributes */
312
312
  attrs?: Record<string, any>;
313
313
  /** @internal Whether this is a closing tag */
@@ -501,8 +501,8 @@ type RequireAtLeastOne<
501
501
  optimizeForStreaming?: boolean;
502
502
  }>;
503
503
  }
504
- declare const RuleType2: typeof RuleTypeConst;
505
- type RuleType2 = RuleTypeValue;
504
+ declare const RuleType: typeof RuleTypeConst;
505
+ type RuleType = RuleTypeValue;
506
506
  /**
507
507
  * Main parser entry point - matches original parser interface
508
508
  */
@@ -576,4 +576,4 @@ declare function astToHTML(nodes: MarkdownToJSX.ASTNode[], options?: HTMLOptions
576
576
  * @returns HTML string
577
577
  */
578
578
  declare function compiler(markdown: string, options?: HTMLOptions): string;
579
- export { slugify, sanitizer, parser, compiler, astToHTML, RuleType2 as RuleType, MarkdownToJSX, HTMLOverrides, HTMLOverride, HTMLOptions };
579
+ export { slugify, sanitizer, parser, compiler, astToHTML, RuleType, MarkdownToJSX, HTMLOverrides, HTMLOverride, HTMLOptions };