Преглед изворни кода

Docs: Improved SchemaContext#concat docs.

Oskar Wróbel пре 8 година
родитељ
комит
18b5b1bf63
1 измењених фајлова са 12 додато и 0 уклоњено
  1. 12 0
      packages/ckeditor5-engine/src/model/schema.js

+ 12 - 0
packages/ckeditor5-engine/src/model/schema.js

@@ -1165,6 +1165,18 @@ export class SchemaContext {
 
 	/**
 	 * Returns new SchemaContext instance with additional items created from provided definition.
+	 * Definition can be:
+	 *
+	 * 		const ctx = new SchemaContext( element ); // [ 'elementParent', 'element' ]
+	 *
+	 * 		// Node.
+	 * 		const ctx2 = ctx.concat( element.getChild( 0 ) ); // [ 'elementParent', 'element', 'elementChild' ]
+	 *
+	 * 		// String (element name).
+	 * 		const ctx3 = ctx.concat( 'other' ); // [ 'elementParent', 'element', 'other' ]
+	 *
+	 * 		// Array with above.
+	 * 		const ctx3 = ctx.concat( [ 'other', element.getChild( 0 ) ] ); // [ 'elementParent', 'element', 'other', 'elementChild ]
 	 *
 	 * @param {String|module:engine/model/node~Node|Array<String|module:engine/model/node~Node>} definition
 	 * Definition of item(s) that will be added to current context.