UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

17 lines (16 loc) 1.05 kB
import type { ReactNode } from "react"; import { type MarkupOptions } from "../../markup/MarkupParser.js"; /** Props for `<Markup>` — extends `MarkupOptions` so callers can override `rules`, `rel`, `url`, `root`, or `schemes` directly. */ export interface MarkupProps extends Partial<MarkupOptions> { /** The source string to parse and render. */ children?: string | undefined; } /** * Parse a markup string and render the resulting elements inline. * - Defaults to `MARKUP_OPTIONS` (full block + inline rule set). Pass `rules`, `rel`, `url`, `root`, or `schemes` as props to override. * - `url`/`root` default to the current `<Meta>` context so link rules resolve site-absolute and relative hrefs. * - Renders inside whatever ancestor element the caller provides — wrap in `<Prose>` to get the standard prose typography for the produced `<p>` / `<ul>` / `<pre>` / etc. * * @example <Prose><Markup>{`A *bold* word with \`code\`.`}</Markup></Prose> */ export declare function Markup({ children, ...options }: MarkupProps): ReactNode;