Convertor

Convertor

Constructor

new Convertor(em)

Parameters:
Name Type Description
em EventManager

EventManager instance

Methods

static factory(eventManager) → {Convertor}

factory
Convertor factory

Parameters:
Name Type Description
eventManager EventManager

eventmanager

Returns:
Convertor

static getMarkdownHighlightRenderer() → {markdownIt}

Return markdown-it highlight renderer

Returns:
markdownIt

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