Przeglądaj źródła

Fixed wrong writer.createElement method examples.

Szymon Kupś 7 lat temu
rodzic
commit
2e022359d1

+ 1 - 1
packages/ckeditor5-engine/src/view/documentselection.js

@@ -51,7 +51,7 @@ export default class DocumentSelection {
 	 *		const selection = new DocumentSelection( position );
 	 *
 	 *		// Creates collapsed selection at the position of given item and offset.
-	 *		const paragraph = writer.createElement( 'paragraph' );
+	 *		const paragraph = writer.createContainerElement( 'paragraph' );
 	 *		const selection = new DocumentSelection( paragraph, offset );
 	 *
 	 *		// Creates a range inside an {@link module:engine/view/element~Element element} which starts before the

+ 1 - 1
packages/ckeditor5-engine/src/view/selection.js

@@ -62,7 +62,7 @@ export default class Selection {
 	 *		const selection = new Selection( position );
 	 *
 	 *		// Creates collapsed selection at the position of given item and offset.
-	 *		const paragraph = writer.createElement( 'paragraph' );
+	 *		const paragraph = writer.createContainerElement( 'paragraph' );
 	 *		const selection = new Selection( paragraph, offset );
 	 *
 	 *		// Creates a range inside an {@link module:engine/view/element~Element element} which starts before the

+ 1 - 0
packages/ckeditor5-engine/src/view/writer.js

@@ -64,6 +64,7 @@ export default class Writer {
 	 *		writer.setSelection( position );
 	 *
 	 * 		// Sets collapsed selection at the position of given item and offset.
+	 *		const paragraph = writer.createContainerElement( 'paragraph' );
 	 *		writer.setSelection( paragraph, offset );
 	 *
 	 * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of