@m2d/react-markdown
Version:
A modern, SSR-friendly React Markdown renderer that preserves the MDAST tree for reuse (e.g., mdast2docx), supports full JSX children, unified plugins, and component overrides.
24 lines (23 loc) • 818 B
TypeScript
import { ComponentProps } from "../../utils";
/**
* Props for the `Unwrap` component.
* - Inherits standard component props including the HAST `node`.
* - `noWarning`: Optional flag to suppress console warnings.
*/
export type UnwrapProps = ComponentProps & {
noWarning?: boolean;
};
/**
* A utility component that unwraps and renders children without their HTML tag.
* Useful for excluding specific tags like `<em>`, `<u>`, etc., while preserving content.
*
* Example usage:
* ```tsx
* components: { em: Unwrap }
* ```
*
* @remarks
* Acts like `disallowedElements + unwrapDisallowed` in other libraries.
* Use `noWarning` to suppress dev-time warnings for expected unwrapping.
*/
export declare const Unwrap: ({ children, noWarning, node: { tagName } }: UnwrapProps) => import("react").ReactNode;