How to use the @ckeditor/ckeditor5-engine/src/model/range.createOn function in @ckeditor/ckeditor5-engine

To help you get started, we’ve selected a few @ckeditor/ckeditor5-engine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ckeditor / ckeditor5-core / tests / command / helpers / getschemavalidranges.js View on Github external
beforeEach( () => {
		document = new Document();
		schema = document.schema;
		root = document.createRoot();

		schema.registerItem( 'p', '$block' );
		schema.registerItem( 'h1', '$block' );
		schema.registerItem( 'img', '$inline' );

		schema.allow( { name: '$text', attributes: 'bold', inside: 'p' } );
		schema.allow( { name: 'p', attributes: 'bold', inside: '$root' } );

		setData( document, '<p>foo<img>bar</p>' );
		ranges = [ Range.createOn( root.getChild( 0 ) ) ];
	} );
github ckeditor / ckeditor5-image / src / widget / widget.js View on Github external
_setSelectionOverElement( element ) {
		this.editor.document.selection.setRanges( [ ModelRange.createOn( element ) ] );
	}