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
markdownis the Markdown code which is to be converted to HTML.optionscontains the customization options which are:base_urlis the base URL to which, relative links will be mapped. Its default value isfalsebidirectionalis a boolean value which determines whether the output will be bidirectional. It default value isfalseadvanced_tablesis also a boolean value, which determines whether to use an advanced parser for tables. It's default value isfalse.
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."
}
JSON
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."
}
}
JSON