Drafts includes a full version of the MultiMarkdown 6 engine to render Markdown text to HTML and other supported formats. For details on the meaning of the various options, refer to MultiMarkdown documentation.

let inputString = "# Header\n\nMy **markdown** text";
let mmd = MultiMarkdown.create();

mmd.format = "html";
mmd.criticMarkup = true;
let outputString = mmd.render(inputString);

Constructors

Properties

completeDocument: boolean

defaults to false

criticMarkup: boolean

defaults to false

criticMarkupAccept: boolean

defaults to false

criticMarkupReject: boolean

defaults to false

footnotesEnabled: boolean

defaults to true

format:
    | "html"
    | "epub"
    | "latex"
    | "beamer"
    | "memoir"
    | "odt"
    | "mmd"

Specify output format. Valid values are:

  • html: HTML. This is the default Markdown output.
  • epub: ePub
  • latex: LaTeX
  • beamer
  • memoir
  • odt: Open document format
  • mmd
markdownCompatibilityMode: boolean

defaults to false

noLabels: boolean

defaults to true

noMetadata: boolean

defaults to false

obfuscate: boolean

defaults to false

processHTML: boolean

defaults to true

randomFootnotes: boolean

defaults to false

smartQuotesEnabled: boolean

defaults to true

snippetOnly: boolean

defaults to false

transclude: boolean

defaults to false

Methods

  • Takes Markdown string passed and processes it with MultiMarkdown based on the properties and format selections on the object.

    Parameters

    • markdownStr: string

    Returns string

""