Markdown

Render an arbitrary Markdown document

POST /markdown

Parameters

Name Type Description
text string Required. The Markdown text to render in HTML. Markdown content must be 400 KB or less.
mode string The rendering mode. Can be either:
* markdown to render a document in plain Markdown, just like README.md files are rendered.
* gfm to render a document in GitHub Flavored Markdown, which creates links for user mentions as well as references to SHA-1 hashes, issues, and pull requests.
Default: markdown
context string The repository context to use when creating references in gfm mode. Omit this parameter when using markdown mode.

Example

{
  "text": "Hello world github/linguist#1 **cool**, and #1!",
  "mode": "gfm",
  "context": "github/gollum"
}

Response

Status: 200 OK
Content-Type: text/html
Content-Length: 279
X-CommonMarker-Version: 0.17.4
<p>Hello world <a href="http://github.com/github/linguist/issues/1" class="issue-link" title="This is a simple issue">github/linguist#1</a> <strong>cool</strong>, and <a href="http://github.com/github/gollum/issues/1" class="issue-link" title="This is another issue">#1</a>!</p>

Render a Markdown document in raw mode

POST /markdown/raw

Parameters

You must send Markdown as plain text (using a Content-Type header of text/plain or text/x-markdown) to this endpoint, rather than using JSON format. In raw mode, GitHub Flavored Markdown is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less.

Example

curl https://api.github.com/markdown/raw -X "POST" -H "Content-Type: text/plain" -d "Hello world github/linguist#1 **cool**, and #1!"

Response

Status: 200 OK
Content-Type: text/html
Content-Length: 68
X-CommonMarker-Version: 0.17.4
<p>Hello world github/linguist#1 <strong>cool</strong>, and #1!</p>