WwCodeBlockManager(wwe)

Class WwCodeBlockManager

new WwCodeBlockManager(wwe)

Creates an instance of WwCodeBlockManager.

Parameters:
Name Type Description
wwe WysiwygEditor

wysiwygEditor instance

Methods

static convertNodesToText(nodes) → {HTMLElement}

Convert table nodes into code block as TSV

Parameters:
Name Type Description
nodes Array.<Node>

Node array

Returns:
HTMLElement -

Code block element

convertNodesToText(nodes) → {string}

Convert nodes to text for pasting to code block

Parameters:
Name Type Description
nodes Array.<Node>

Node array

Returns:
string -

coverted string

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}

Prepare nodes for pasting to code block

Parameters:
Name Type Description
nodes Array.<Node>

Node array

Returns:
DocumentFragment