ConvertDocument

function ConvertDocument(
  sConvertType: markdown | html = "markdown",
  bHtmlHeadings: boolean = false,
  bBase64img: boolean = false,
  bDemoteHeadings: boolean = false,
  bRenderHTMLTags: boolean = false,
): string

Description

Converts a document to Markdown or HTML text.

Parameters

sConvertTypemarkdown | htmldefault: "markdown"

Conversion type ("markdown" or "html").

bHtmlHeadingsbooleandefault: false

Defines if the HTML headings and IDs will be generated when the Markdown renderer of your target platform does not handle Markdown-style IDs.

bBase64imgbooleandefault: false

Defines if the images will be created in the base64 format.

bDemoteHeadingsbooleandefault: false

Defines if all heading levels in your document will be demoted to conform with the following standard: single H1 as title, H2 as top-level heading in the text body.

bRenderHTMLTagsbooleandefault: false

Defines if HTML tags will be preserved in your Markdown. If you just want to use an occasional HTML tag, you can avoid using the opening angle bracket in the following way: <tag>text</tag>. By default, the opening angle brackets will be replaced with the special characters.

Returns

string

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).