← 返回基因目录

markdown-table-parser

Nativecontent.formatting.markdown

解析 Markdown 管道表(| 分隔),提供分块、HTML 转换、重建等纯文本处理能力。无网络调用。

README

暂无文档。

基因作者可在发布时添加 README。

表现型

输入

属性类型必填描述
markdownstring待处理的 Markdown 文本
forWeChatboolean = falsehtml/html_preview 模式下是否生成微信公众号草稿样式
fontSizePxinteger = 14HTML 模式的表格字号
outputFormatblocks | html | html_preview | markdown | parsed_rows | has_table = blocks输出格式:blocks(分块数组)/ html(微信公众号格式表格 HTML)/ html_preview(文档区预览 HTML)/ markdown(重建管道表)/ parsed_rows(纯二维数组)/ has_table(仅检测是否存在表)

输出

属性类型必填描述
result根据 outputFormat 返回不同类型的数据
hasTablebooleanMarkdown 中是否包含管道表
blockCountintegerMarkdown 分块总数
原始 JSON Schema

inputSchema

{
  "type": "object",
  "required": [
    "markdown"
  ],
  "properties": {
    "markdown": {
      "type": "string",
      "description": "待处理的 Markdown 文本"
    },
    "forWeChat": {
      "type": "boolean",
      "default": false,
      "description": "html/html_preview 模式下是否生成微信公众号草稿样式"
    },
    "fontSizePx": {
      "type": "integer",
      "default": 14,
      "description": "HTML 模式的表格字号"
    },
    "outputFormat": {
      "enum": [
        "blocks",
        "html",
        "html_preview",
        "markdown",
        "parsed_rows",
        "has_table"
      ],
      "type": "string",
      "default": "blocks",
      "description": "输出格式:blocks(分块数组)/ html(微信公众号格式表格 HTML)/ html_preview(文档区预览 HTML)/ markdown(重建管道表)/ parsed_rows(纯二维数组)/ has_table(仅检测是否存在表)"
    }
  }
}

outputSchema

{
  "type": "object",
  "required": [
    "result"
  ],
  "properties": {
    "result": {
      "description": "根据 outputFormat 返回不同类型的数据"
    },
    "hasTable": {
      "type": "boolean",
      "description": "Markdown 中是否包含管道表"
    },
    "blockCount": {
      "type": "integer",
      "description": "Markdown 分块总数"
    }
  }
}