X114
返回 API 總覽

markdown-render

POST1 積分

Renders GitHub-flavored Markdown to either sanitized HTML or plain text. The HTML output is sanitized server-side (no script tags, no inline event handlers).

端點

POST https://x114.org/api/v1/markdown-render

請求體

以 JSON 形式放在 POST 請求體中。

NameTypeRequiredDescription
markdownstringrequiredThe Markdown source. Up to 1 MB of UTF-8.

響應體

成功時返回的 JSON(HTTP 200)。

NameTypeRequiredDescription
okbooleanrequiredTrue on success.
htmlstringrequiredThe rendered HTML (GitHub-flavored Markdown, raw HTML disabled).

示例

curl -X POST https://x114.org/api/v1/markdown-render \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{"markdown":"# Hello\n\n**world**"}'

備註

  • Raw HTML inside the Markdown source is stripped before rendering — script tags and inline event handlers cannot reach the output.
在瀏覽器裏試

這個免費工具無需寫代碼即可得到相同結果。

打開工具