Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CKTESTER.editor = { config : { autoParagraph : false } };
CKTESTER.test(
{
test_a : function()
{
var editor = this.editor,
editable = editor.editable();
editable.setHtml( 'abcdef' );
var node = editable.getFirst();
var range = new CKEDITOR.dom.range( editable.getDocument(), editable );
// a[bcde]f
range.setStart( node, 1 );
range.setEnd( node, 5 );
editor.getSelection().selectRanges( [ range ] );
var ranges = editor.getSelection().getRanges();
assert.areEqual( 1, ranges.length );
range = ranges[ 0 ];
assert.areSame( node, range.startContainer );
assert.areSame( node, range.endContainer );
assert.areSame( 1, range.startOffset );
assert.areSame( 5, range.endOffset );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.