markdown-to-jsx 9.2.0 → 9.3.1

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
@@ -54,7 +54,7 @@ type RequireAtLeastOne<
54
54
  /** true if parsing in an inline context (subset of rules around formatting and links) */
55
55
  inline?: boolean;
56
56
  /** use this for the `key` prop */
57
- key?: React.Key;
57
+ key?: string | number;
58
58
  /** reference definitions (footnotes are stored with '^' prefix) */
59
59
  refs?: {
60
60
  [key: string]: {
@@ -183,6 +183,7 @@ type RequireAtLeastOne<
183
183
  attrs?: Record<string, any>;
184
184
  isClosingTag?: boolean;
185
185
  tag: string;
186
+ rawText?: string;
186
187
  }
187
188
  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;
188
189
  export type ASTRender = (ast: MarkdownToJSX.ASTNode | MarkdownToJSX.ASTNode[], state: MarkdownToJSX.State) => React.ReactNode;
@@ -270,7 +271,7 @@ type RequireAtLeastOne<
270
271
  * Override the built-in sanitizer function for URLs, etc if desired. The built-in version is available as a library
271
272
  export called `sanitizer`.
272
273
  */
273
- sanitizer: (value: string, tag: HTMLTags, attribute: string) => string | null;
274
+ sanitizer: (value: string, tag: string, attribute: string) => string | null;
274
275
  /**
275
276
  * Override normalization of non-URI-safe characters for use in generating
276
277
  * HTML IDs for anchor linking purposes.
@@ -350,6 +351,7 @@ type HTMLOptions = Omit<MarkdownToJSX.Options, "createElement" | "wrapperProps"
350
351
  renderRule?: (next: () => string, node: MarkdownToJSX.ASTNode, renderChildren: (children: MarkdownToJSX.ASTNode[]) => string, state: MarkdownToJSX.State) => string;
351
352
  overrides?: HTMLOverrides;
352
353
  wrapperProps?: Record<string, string | number | boolean>;
354
+ wrapperWasAutoSet?: boolean;
353
355
  };
354
356
  declare function astToHTML(nodes: MarkdownToJSX.ASTNode[], options?: HTMLOptions): string;
355
357
  /**
package/dist/html.d.ts CHANGED
@@ -54,7 +54,7 @@ type RequireAtLeastOne<
54
54
  /** true if parsing in an inline context (subset of rules around formatting and links) */
55
55
  inline?: boolean;
56
56
  /** use this for the `key` prop */
57
- key?: React.Key;
57
+ key?: string | number;
58
58
  /** reference definitions (footnotes are stored with '^' prefix) */
59
59
  refs?: {
60
60
  [key: string]: {
@@ -183,6 +183,7 @@ type RequireAtLeastOne<
183
183
  attrs?: Record<string, any>;
184
184
  isClosingTag?: boolean;
185
185
  tag: string;
186
+ rawText?: string;
186
187
  }
187
188
  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;
188
189
  export type ASTRender = (ast: MarkdownToJSX.ASTNode | MarkdownToJSX.ASTNode[], state: MarkdownToJSX.State) => React.ReactNode;
@@ -270,7 +271,7 @@ type RequireAtLeastOne<
270
271
  * Override the built-in sanitizer function for URLs, etc if desired. The built-in version is available as a library
271
272
  export called `sanitizer`.
272
273
  */
273
- sanitizer: (value: string, tag: HTMLTags, attribute: string) => string | null;
274
+ sanitizer: (value: string, tag: string, attribute: string) => string | null;
274
275
  /**
275
276
  * Override normalization of non-URI-safe characters for use in generating
276
277
  * HTML IDs for anchor linking purposes.
@@ -350,6 +351,7 @@ type HTMLOptions = Omit<MarkdownToJSX.Options, "createElement" | "wrapperProps"
350
351
  renderRule?: (next: () => string, node: MarkdownToJSX.ASTNode, renderChildren: (children: MarkdownToJSX.ASTNode[]) => string, state: MarkdownToJSX.State) => string;
351
352
  overrides?: HTMLOverrides;
352
353
  wrapperProps?: Record<string, string | number | boolean>;
354
+ wrapperWasAutoSet?: boolean;
353
355
  };
354
356
  declare function astToHTML(nodes: MarkdownToJSX.ASTNode[], options?: HTMLOptions): string;
355
357
  /**