markdown-to-jsx 9.2.0 → 9.3.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 +93 -20
- package/dist/html.cjs +97 -96
- package/dist/html.d.cts +4 -2
- package/dist/html.d.ts +4 -2
- package/dist/html.js +97 -96
- package/dist/html.js.map +7 -7
- package/dist/index.cjs +85 -85
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +83 -83
- package/dist/index.js.map +7 -7
- package/dist/markdown.cjs +93 -93
- package/dist/markdown.js +93 -93
- package/dist/markdown.js.map +6 -6
- package/dist/native.cjs +100 -100
- package/dist/native.d.cts +3 -2
- package/dist/native.d.ts +3 -2
- package/dist/native.js +102 -102
- package/dist/native.js.map +7 -7
- package/dist/react.cjs +83 -83
- package/dist/react.d.cts +4 -8
- package/dist/react.d.ts +4 -8
- package/dist/react.js +85 -85
- package/dist/react.js.map +7 -7
- package/dist/solid.cjs +108 -0
- package/dist/solid.d.cts +373 -0
- package/dist/solid.d.ts +373 -0
- package/dist/solid.js +108 -0
- package/dist/solid.js.map +15 -0
- package/dist/vue.cjs +108 -0
- package/dist/vue.d.cts +373 -0
- package/dist/vue.d.ts +373 -0
- package/dist/vue.js +108 -0
- package/dist/vue.js.map +15 -0
- package/package.json +43 -4
package/dist/react.d.cts
CHANGED
|
@@ -55,7 +55,7 @@ type RequireAtLeastOne<
|
|
|
55
55
|
/** true if parsing in an inline context (subset of rules around formatting and links) */
|
|
56
56
|
inline?: boolean;
|
|
57
57
|
/** use this for the `key` prop */
|
|
58
|
-
key?:
|
|
58
|
+
key?: string | number;
|
|
59
59
|
/** reference definitions (footnotes are stored with '^' prefix) */
|
|
60
60
|
refs?: {
|
|
61
61
|
[key: string]: {
|
|
@@ -184,6 +184,7 @@ type RequireAtLeastOne<
|
|
|
184
184
|
attrs?: Record<string, any>;
|
|
185
185
|
isClosingTag?: boolean;
|
|
186
186
|
tag: string;
|
|
187
|
+
rawText?: string;
|
|
187
188
|
}
|
|
188
189
|
export type ASTNode = BlockQuoteNode | BreakLineNode | BreakThematicNode | CodeBlockNode | CodeInlineNode | FootnoteNode | FootnoteReferenceNode | FrontmatterNode | GFMTaskNode | HeadingNode | HTMLCommentNode | ImageNode | LinkNode | OrderedListNode | UnorderedListNode | ParagraphNode | ReferenceNode | ReferenceCollectionNode | TableNode | TextNode | FormattedTextNode | HTMLNode | HTMLSelfClosingNode;
|
|
189
190
|
export type ASTRender = (ast: MarkdownToJSX.ASTNode | MarkdownToJSX.ASTNode[], state: MarkdownToJSX.State) => React.ReactNode;
|
|
@@ -271,7 +272,7 @@ type RequireAtLeastOne<
|
|
|
271
272
|
* Override the built-in sanitizer function for URLs, etc if desired. The built-in version is available as a library
|
|
272
273
|
export called `sanitizer`.
|
|
273
274
|
*/
|
|
274
|
-
sanitizer: (value: string, tag:
|
|
275
|
+
sanitizer: (value: string, tag: string, attribute: string) => string | null;
|
|
275
276
|
/**
|
|
276
277
|
* Override normalization of non-URI-safe characters for use in generating
|
|
277
278
|
* HTML IDs for anchor linking purposes.
|
|
@@ -334,11 +335,6 @@ declare global {
|
|
|
334
335
|
declare function parser(source: string, options?: MarkdownToJSX.Options): MarkdownToJSX.ASTNode[];
|
|
335
336
|
declare function sanitizer(input: string): string | null;
|
|
336
337
|
declare function slugify(str: string): string;
|
|
337
|
-
/**
|
|
338
|
-
* Convert HTML attributes to JSX props
|
|
339
|
-
* Maps HTML attribute names (e.g., "class", "for") to JSX prop names (e.g., "className", "htmlFor")
|
|
340
|
-
*/
|
|
341
|
-
declare function htmlAttrsToJSXProps(attrs: Record<string, any>): Record<string, any>;
|
|
342
338
|
declare function astToJSX(ast: MarkdownToJSX.ASTNode[], options?: MarkdownToJSX.Options): React2.ReactNode;
|
|
343
339
|
declare function compiler(markdown?: string, options?: MarkdownToJSX.Options): React2.ReactNode;
|
|
344
340
|
/**
|
|
@@ -349,4 +345,4 @@ declare const Markdown: React2.FC<Omit<React2.HTMLAttributes<Element>, "children
|
|
|
349
345
|
children?: string | null;
|
|
350
346
|
options?: MarkdownToJSX.Options;
|
|
351
347
|
}>;
|
|
352
|
-
export { slugify, sanitizer, parser,
|
|
348
|
+
export { slugify, sanitizer, parser, Markdown as default, compiler, astToJSX, RuleType2 as RuleType, MarkdownToJSX, Markdown };
|
package/dist/react.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ type RequireAtLeastOne<
|
|
|
55
55
|
/** true if parsing in an inline context (subset of rules around formatting and links) */
|
|
56
56
|
inline?: boolean;
|
|
57
57
|
/** use this for the `key` prop */
|
|
58
|
-
key?:
|
|
58
|
+
key?: string | number;
|
|
59
59
|
/** reference definitions (footnotes are stored with '^' prefix) */
|
|
60
60
|
refs?: {
|
|
61
61
|
[key: string]: {
|
|
@@ -184,6 +184,7 @@ type RequireAtLeastOne<
|
|
|
184
184
|
attrs?: Record<string, any>;
|
|
185
185
|
isClosingTag?: boolean;
|
|
186
186
|
tag: string;
|
|
187
|
+
rawText?: string;
|
|
187
188
|
}
|
|
188
189
|
export type ASTNode = BlockQuoteNode | BreakLineNode | BreakThematicNode | CodeBlockNode | CodeInlineNode | FootnoteNode | FootnoteReferenceNode | FrontmatterNode | GFMTaskNode | HeadingNode | HTMLCommentNode | ImageNode | LinkNode | OrderedListNode | UnorderedListNode | ParagraphNode | ReferenceNode | ReferenceCollectionNode | TableNode | TextNode | FormattedTextNode | HTMLNode | HTMLSelfClosingNode;
|
|
189
190
|
export type ASTRender = (ast: MarkdownToJSX.ASTNode | MarkdownToJSX.ASTNode[], state: MarkdownToJSX.State) => React.ReactNode;
|
|
@@ -271,7 +272,7 @@ type RequireAtLeastOne<
|
|
|
271
272
|
* Override the built-in sanitizer function for URLs, etc if desired. The built-in version is available as a library
|
|
272
273
|
export called `sanitizer`.
|
|
273
274
|
*/
|
|
274
|
-
sanitizer: (value: string, tag:
|
|
275
|
+
sanitizer: (value: string, tag: string, attribute: string) => string | null;
|
|
275
276
|
/**
|
|
276
277
|
* Override normalization of non-URI-safe characters for use in generating
|
|
277
278
|
* HTML IDs for anchor linking purposes.
|
|
@@ -334,11 +335,6 @@ declare global {
|
|
|
334
335
|
declare function parser(source: string, options?: MarkdownToJSX.Options): MarkdownToJSX.ASTNode[];
|
|
335
336
|
declare function sanitizer(input: string): string | null;
|
|
336
337
|
declare function slugify(str: string): string;
|
|
337
|
-
/**
|
|
338
|
-
* Convert HTML attributes to JSX props
|
|
339
|
-
* Maps HTML attribute names (e.g., "class", "for") to JSX prop names (e.g., "className", "htmlFor")
|
|
340
|
-
*/
|
|
341
|
-
declare function htmlAttrsToJSXProps(attrs: Record<string, any>): Record<string, any>;
|
|
342
338
|
declare function astToJSX(ast: MarkdownToJSX.ASTNode[], options?: MarkdownToJSX.Options): React2.ReactNode;
|
|
343
339
|
declare function compiler(markdown?: string, options?: MarkdownToJSX.Options): React2.ReactNode;
|
|
344
340
|
/**
|
|
@@ -349,4 +345,4 @@ declare const Markdown: React2.FC<Omit<React2.HTMLAttributes<Element>, "children
|
|
|
349
345
|
children?: string | null;
|
|
350
346
|
options?: MarkdownToJSX.Options;
|
|
351
347
|
}>;
|
|
352
|
-
export { slugify, sanitizer, parser,
|
|
348
|
+
export { slugify, sanitizer, parser, Markdown as default, compiler, astToJSX, RuleType2 as RuleType, MarkdownToJSX, Markdown };
|