How to use the @ckeditor/ckeditor5-engine/src/view/documentfragment 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-image / tests / image / utils.js View on Github external
it( 'should return true when image widget is the only element in the selection', () => {
			// We need to create a container for the element to be able to create a Range on this element.
			frag = new ViewDocumentFragment( [ element ] );

			const selection = writer.createSelection( element, 'on' );

			expect( getSelectedImageWidget( selection ) ).to.equal( element );
		} );
github ckeditor / ckeditor5-image / tests / image / utils.js View on Github external
it( 'should return false when widget element is not the only element in the selection', () => {
			const notWidgetizedElement = writer.createContainerElement( 'p' );

			frag = new ViewDocumentFragment( [ element, notWidgetizedElement ] );

			const selection = writer.createSelection( writer.createRangeIn( frag ) );

			expect( getSelectedImageWidget( selection ) ).to.be.null;
		} );
	} );
github ckeditor / ckeditor5-markdown-gfm / src / renderer / renderer.js View on Github external
if ( currentParent ) {
						currentParent.appendChildren( newNode );
					}

					if ( node.isContainer ) {
						currentParent = newNode;
					}
				} else {
					if ( currentParent.parent ) {
						currentParent = currentParent.parent;
					}
				}
			}
		}

		return currentParent || new ViewDocumentFragment();
	}
}