WwCodeBlockManager(wwe)

Class WwCodeBlockManager

new WwCodeBlockManager(wwe)

Creates an instance of WwCodeBlockManager.

Parameters:
Name Type Description
wwe WysiwygEditor

wysiwygEditor instance

Methods

static convertToCodeblock(nodes) → {HTMLElement}

Wrap table nodes into code block as TSV

Parameters:
Name Type Description
nodes Array.<Node>

Node array

Returns:
HTMLElement -

Code block element

convertToCodeblock(nodes) → {HTMLElement}

Wrap nodes into code block

Parameters:
Name Type Description
nodes Array.<Node>

Node array

Returns:
HTMLElement -

Code block element

destroy()

Destroy.

isInCodeBlock(range) → {boolean}

Return boolean value of whether current range is in the code block

Parameters:
Name Type Description
range Range

Range object

Returns:
boolean

prepareToPasteOnCodeblock(nodes) → {DocumentFragment}

Convert copied nodes to code block if need

Parameters:
Name Type Description
nodes Array.<Node>

Node array

Returns:
DocumentFragment