{
  "docPath": "docs/data-display/markdown.tsx",
  "example": "import { Prose } from \"@godxjp/ui/data-display\";\nimport { Markdown } from \"@godxjp/markdown\";\n\n<Prose measure=\"narrow\">\n  <Markdown resolveUrl={(url) => (url.startsWith(\"asset:\") ? assetUrl(url) : undefined)}>\n    {page.body}\n  </Markdown>\n</Prose>",
  "group": "data-display",
  "importPath": "@godxjp/markdown",
  "name": "Markdown",
  "props": [
    {
      "description": "The Markdown source.",
      "name": "children",
      "required": true,
      "type": "string"
    },
    {
      "description": "Host markers (callouts, embeds), run after GFM. Their output is still sanitised — allow marker attributes with `schema`.",
      "name": "remarkPlugins",
      "type": "PluggableList"
    },
    {
      "description": "Tags / attributes a host plugin needs. A rule for an attribute the base already constrains is MERGED into it (e.g. `code` `className` + `math-inline`), gh#1116. It can never widen the URL policy or bring raw HTML back.",
      "name": "schema",
      "type": "{ tagNames?: string[]; attributes?: Record<string, …> }"
    },
    {
      "description": "Map a host scheme (`asset:…`, wiki links) to a real URL. Runs BEFORE the sanitiser, which then judges the result.",
      "name": "resolveUrl",
      "type": "(url, key) => string | undefined"
    },
    {
      "description": "Server-assigned anchors instead of GitHub slugs.",
      "name": "headingId",
      "type": "({ depth, text, index }) => string | undefined"
    },
    {
      "description": "Element overrides (react-markdown). Mermaid fences are drawn through the gate BEFORE a host `pre` is asked, so a host code renderer keeps Mermaid (gh#1116).",
      "name": "components",
      "type": "Components"
    },
    {
      "description": "Run AFTER the sanitiser — presentation only.",
      "name": "rehypePlugins",
      "type": "PluggableList"
    },
    {
      "description": "Narrow the elements a body may produce (with `unwrapDisallowed` to keep their text) — an activity feed showing only strong / em / del / code. Only removes; never allows what the schema strips (gh#1116).",
      "name": "allowedElements",
      "type": "string[]"
    },
    {
      "defaultValue": "24",
      "description": "A table cell whose trimmed text has no whitespace and at most this many characters (grapheme clusters) — a code, an id, a date, 優先度 — is stamped data-short, and Prose keeps it on one line (CJK otherwise breaks between ideographs in a narrow column). Sentences still wrap. false stamps nothing (gh#1150). Images in Prose table cells are capped at --prose-cell-image-max-inline-size (20rem) so a narrow table scrolls instead of squashing them.",
      "name": "shortCellLength",
      "type": "number | false"
    },
    {
      "description": "Default 'same-tab'. Renderer policy for links to another origin (an absolute http(s) URL whose origin differs from `origin`). 'new-tab' adds target=\"_blank\" rel=\"noopener noreferrer\"; relative links, #anchors, resolved wikilinks and mailto: stay in the tab. Markdown cannot store target, so this replaces it.",
      "name": "externalLinks",
      "type": "'same-tab' | 'new-tab'"
    },
    {
      "description": "The page origin externalLinks compares against; defaults to location.origin. Pass it for server rendering, or every absolute link counts as external there.",
      "name": "origin",
      "type": "string"
    },
    {
      "description": "Visible titles for GitHub-alert callouts (`> [!WARNING]`) that carry none of their own. English by default (the package has no i18n); pass localized strings. Grammar v1 (gh#1156): callouts, `:::toggle[summary]`, `::::columns`/`:::column{width=N}`, CJK-friendly emphasis — the same syntax the pure codec at `@godxjp/markdown/codec` (CODEC_ID kit-md@1, parse/serialize/normalize, DOM-free) and @godxjp/block-editor use.",
      "name": "calloutTitles",
      "type": "Partial<Record<'note' | 'tip' | 'important' | 'warning' | 'caution', string>>"
    },
    {
      "defaultValue": "true",
      "description": "`false` keeps ```mermaid fences as code. Diagrams need the optional peer `mermaid`.",
      "name": "mermaid",
      "type": "boolean"
    }
  ],
  "related": [
    "Prose — the typography wrapper this renders into.",
    "MarkdownEditor — editing; its preview is this renderer.",
    "CodeBlock — a single block of preformatted text, not a document."
  ],
  "rules": [],
  "storyPath": "data-display/markdown.tsx",
  "tagline": "The one Markdown renderer for GoDX apps (sibling package `@godxjp/markdown`, versioned with the kit): GFM + GitHub heading anchors, one sanitiser schema (no raw HTML; http/https/mailto/relative URLs only), and ```mermaid drawn only after its SVG passes a fail-closed gate (gh#1108). Wrap it in `Prose`.",
  "usage": [
    "DO let the document language do Japanese line breaking: under `:lang(ja)` (AppProvider sets `<html lang>`) every prose paragraph and list item breaks between PHRASES — `word-break: auto-phrase` + `line-break: strict`, the `Text break=\"phrase\"` behaviour (gh#1310) — so 「新しく参加」 is not cut 「新し｜く参加」. Latin and Vietnamese wrap unchanged; a phrase longer than the line still breaks inside itself. A browser without `auto-phrase` keeps its own CJK breaking.",
    "Table of contents: outline(markdown) from @godxjp/markdown/codec returns { depth, text, id }[] with exactly the ids <Markdown> writes — feed it to the kit Anchor. YAML front matter is kept verbatim and never rendered; frontmatterOf(markdown) returns it (gh#1163).",
    "DO `<Prose><Markdown>{body}</Markdown></Prose>` for every rendered body (wiki page, issue, mail).",
    "DO record `MARKDOWN_FORMAT` and `RENDERER_VERSION` on stored versions.",
    "DON'T assemble react-markdown + rehype-sanitize per app, add rehype-raw, or render Mermaid yourself — `checkMermaidSvg` is the gate."
  ]
}
