blockly > Xml > blockToDom

Xml.blockToDom() function

Encode a block subtree as XML.

Signature:

export declare function blockToDom(block: Block, opt_noId?: boolean): Element | DocumentFragment;

Parameters

Parameter Type Description
block Block The root block to encode.
opt_noId boolean (Optional) True if the encoder should skip the block ID.

Returns:

Element | DocumentFragment

Tree of XML elements or an empty document fragment if the block was an insertion marker.