CodeBlockManager()

Class Code Block Manager

new CodeBlockManager()

Creates an instance of CodeBlockManager.

Methods

static getHighlightJSLanguages() → {Array.<string>}

get supported languages by highlight-js

Returns:
Array.<string> -
  • supported languages by highlight-js

createCodeBlockHtml(language, codeText) → {string}

Create code block html.

Parameters:
Name Type Description
language string

code block language

codeText string

code text

Returns:
string

getReplacer(language) → {function}

get replacer for code block

Parameters:
Name Type Description
language string

code block type

Returns:
function -
  • replacer function

setReplacer(language, replacer)

Set replacer for code block

Parameters:
Name Type Description
language string

code block language

replacer function

replacer function to code block element