SCEditor

getFirstBlockParent

getFirstBlockParent() Since: 1.3.5

Gets the first block level parent node of the current selection.

Syntax

var parent = instance.getFirstBlockParent([node]);

Parameters

node
Type: Node

If specified, this method will get the first block level parent of the specified node instead of getting the first block parent of the current selection.

Return

Type: Range

Will return null if there is no current selection.