Markdown to HTML

The /md_to_html endpoint converts the given Markdown code to HTML. This endpoint is also a little customizable via the options parameter in the request body.

Method: POST

To make a request, just send a request to the /md_to_html endpoint via POST method, with the required parameters and the authorization headers.

Parameters

This endpoint accepts only two parameters, namely, markdown and options

  • markdown is the Markdown code which is to be converted to HTML.
  • options contains the customization options which are:
    • base_url is the base URL to which, relative links will be mapped. Its default value is false
    • bidirectional is a boolean value which determines whether the output will be bidirectional. It default value is false
    • advanced_tables is also a boolean value, which determines whether to use an advanced parser for tables. It's default value is false.

Responses

The success response is as follows, where the data object contains the converted HTML in html.

{
  "status": "success",
  "data": {
    "source_markdown": "# Heading \n Paragraph with *emphasized* and **strong** text.",
    "html": "<h1>Heading</h1>\n<p> Paragraph with <em>emphasized</em> and <strong>strong</strong> text.</p>\n",
    "options_applied": {
      "advanced_tables": true
    }
  },
  "message": "Markdown to HTML conversion was successful."
}

And when not providing the markdown parameter in request body, the error response is as usual:

{
  "status": "error",
  "error": {
    "code": "INVALID_INPUT",
    "message": "'markdown' is required and must be a valid Markdown string.",
    "details": "Ensure the request body includes a 'markdown' field of type string."
  }
}