Take a look at our new Article and Redactor X editors.

Documentation

Marker

build #

Arguments
pos String

Returns: Node

Return the special marker node.

var start = this.marker.build('start');
var end = this.marker.build('end');

buildHtml #

Arguments
pos String

Returns: String

Return the special marker as a HTML string.

var start = this.marker.buildHtml('start');
var end = this.marker.buildHtml('end');

insert #

Arguments
side String

Insert the special marker around for the selection.

// at the both sides of the selection
this.marker.insert();
// at the beginning
this.marker.insert('start');

find #

Arguments
pos String
context (optional) Dom

Returns: Node Boolean

Find and return the special marker node inside the editor or the specified context. Return false if a marker it is not found.

var marker = this.marker.find('start');
var marker = this.marker.find('start', $element);

remove #

Remove all special markers inside the editor.

this.marker.remove();