{
  "slug": "markdown-link-flattener",
  "name": "gizza-ai/markdown-link-flattener",
  "version": "0.1.0",
  "title": "Markdown Link Flattener — remove link syntax, keep text — gizza.ai",
  "description": "Paste Markdown and replace inline links with visible text, text plus URL, or URL-only output while preserving code examples.",
  "tags": [
    "markdown link flattener",
    "remove markdown links",
    "markdown links to text",
    "strip markdown links",
    "markdown url extractor",
    "flatten markdown"
  ],
  "category": "documents",
  "urls": {
    "page": "https://gizza.ai/tools/markdown-link-flattener/",
    "markdown": "https://gizza.ai/tools/markdown-link-flattener/index.md",
    "descriptor": "https://gizza.ai/tools/markdown-link-flattener/tool.json",
    "deep_link_example": "https://gizza.ai/tools/markdown-link-flattener/?markdown=Read%20%5Bthe%20docs%5D%28https%3A%2F%2Fexample.com%2Fdocs%29%20and%20see%20%21%5Bdiagram%5D%28diagram.png%29.%0A%0A%5Bold-ref%5D%3A%20https%3A%2F%2Fexample.com%2Fold%0A%0A%60%5Bexample%5D%28kept%29%60&link_mode=text&image_mode=alt_text&reference_definitions=drop&preserve_code=true"
  },
  "cli": "gizza tool markdown-link-flattener 'Read [the docs](https://example.com/docs) and see ![diagram](diagram.png).\n\n[old-ref]: https://example.com/old\n\n`[example](kept)`'",
  "tool": {
    "description": "Flatten Markdown links in pasted Markdown. Pass `markdown` and choose `link_mode`: `text` keeps only visible link text, `text_url` writes `text (url)`, and `url` keeps only destinations. Images are controlled separately with `image_mode`: keep alt text, alt text plus URL, drop them, or preserve image Markdown. Reference definition lines can be dropped or kept with `reference_definitions`; dropping is useful after inline link syntax has been removed. `preserve_code` leaves backtick code spans and fenced code blocks unchanged by default so examples of Markdown syntax are not altered. Up to 1000000 bytes, deterministic and browser-local.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "image_mode": {
          "default": "alt_text",
          "description": "How image syntax is treated. alt_text keeps the image alt text, alt_url writes alt text plus the image URL, drop removes the image entirely, and keep_markdown leaves image syntax untouched while still flattening normal links.",
          "enum": [
            "alt_text",
            "alt_url",
            "drop",
            "keep_markdown"
          ],
          "type": "string"
        },
        "link_mode": {
          "default": "text",
          "description": "How normal inline links are rewritten. text keeps only the visible label, so [docs](https://example.com) becomes docs. text_url keeps the label and appends the destination in parentheses, producing docs (https://example.com). url keeps only the destination.",
          "enum": [
            "text",
            "text_url",
            "url"
          ],
          "type": "string"
        },
        "markdown": {
          "description": "Markdown text whose inline links should be flattened. Inline links like [visible text](https://example.com), image links like ![alt](image.png), and reference definition lines like [id]: https://example.com are handled. Code spans and fenced code blocks are preserved by default. Up to 1000000 bytes per run.",
          "type": "string"
        },
        "preserve_code": {
          "default": true,
          "description": "Leave backtick code spans and fenced code blocks unchanged. On by default so README snippets like `[x](y)` keep showing Markdown syntax. Turn it off only when the whole document should be flattened even inside examples.",
          "type": "boolean"
        },
        "reference_definitions": {
          "default": "drop",
          "description": "Whether reference definition lines such as [docs]: https://example.com are removed. drop is the default because the inline link syntax has been flattened and the definitions usually become dead footnotes. keep leaves those lines as written.",
          "enum": [
            "drop",
            "keep"
          ],
          "type": "string"
        }
      },
      "required": [
        "markdown"
      ],
      "type": "object"
    }
  }
}