Convertor(em)

Class Convertor

new Convertor(em)

Convertor constructor

Parameters:
Name Type Description
em EventManager

EventManager instance

Methods

static getMarkdownitHighlightRenderer() → {markdownit}

get markdownit with code highlight

Returns:
markdownit -
  • markdownit instance

toHTML(markdown) → {string}

toHTML
Convert markdown to html
emit convertorAfterMarkdownToHtmlConverted

Parameters:
Name Type Description
markdown string

markdown text

Returns:
string -

html text

toHTMLWithCodeHightlight(markdown) → {string}

toHTMLWithCodeHightlight
Convert markdown to html with Codehighlight
emit convertorAfterMarkdownToHtmlConverted

Parameters:
Name Type Description
markdown string

markdown text

Returns:
string -

html text

toMarkdown(html, toMarkOptions) → {string}

toMarkdown
Convert html to markdown
emit convertorAfterHtmlToMarkdownConverted

Parameters:
Name Type Description
html string

html text

toMarkOptions object | null

toMark library options

Returns:
string -

markdown text