Kaynağa Gözat

Fixed API docs.

Piotrek Koszuliński 9 yıl önce
ebeveyn
işleme
5d363f21e9

+ 8 - 8
packages/ckeditor5-engine/src/conversion/view-converter-builder.js

@@ -28,11 +28,11 @@ import isIterable from '../../utils/isiterable.js';
  *
  * 2. View element to model attribute:
  *
- *		BuildViewConverterFor( dispatcher ).fromElement( 'b' ).fromElement( 'strong' ).toAttribute( bold, true );
+ *		BuildViewConverterFor( dispatcher ).fromElement( 'b' ).fromElement( 'strong' ).toAttribute( 'bold', 'true' );
  *
  * 3. View attribute to model attribute:
  *
- *		BuildViewConverterFor( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( bold, true );
+ *		BuildViewConverterFor( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( 'bold', 'true' );
  *		BuildViewConverterFor( dispatcher )
  *			.fromAttribute( 'class' )
  *			.toAttribute( ( viewElement ) => ( { class: viewElement.getAttribute( 'class' ) } ) );
@@ -41,7 +41,7 @@ import isIterable from '../../utils/isiterable.js';
  *
  *		BuildViewConverterFor( dispatcher )
  *			.fromElement( 'b' ).fromElement( 'strong' ).fromAttribute( 'style', { 'font-weight': 'bold' } )
- *			.toAttribute( bold, true );
+ *			.toAttribute( 'bold', 'true' );
  *
  * 5. View {@link engine.view.Matcher view element matcher instance} or {@link engine.view.Matcher#add matcher pattern}
  * to model element or attribute:
@@ -50,7 +50,7 @@ import isIterable from '../../utils/isiterable.js';
  *		matcher.add( 'div', { class: 'quote' } );
  *		BuildViewConverterFor( dispatcher ).from( matcher ).toElement( 'quote' );
  *
- *		BuildViewConverterFor( dispatcher ).from( { name: 'span', class: 'bold' } ).toAttribute( bold, true );
+ *		BuildViewConverterFor( dispatcher ).from( { name: 'span', class: 'bold' } ).toAttribute( 'bold', 'true' );
  *
  * Note, that converters built using `ViewConverterBuilder` automatically check {@link engine.model.Schema schema}
  * if created model structure is valid. If given conversion would be invalid according to schema, it is ignored.
@@ -118,7 +118,7 @@ class ViewConverterBuilder {
 	/**
 	 * Registers what view attribute should be converted.
 	 *
-	 *		BuildViewConverterFor( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( bold, true );
+	 *		BuildViewConverterFor( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( 'bold', 'true' );
 	 *
 	 * @chainable
 	 * @param {String|RegExp} key View attribute key.
@@ -140,7 +140,7 @@ class ViewConverterBuilder {
 	 *		matcher.add( 'div', { class: 'quote' } );
 	 *		BuildViewConverterFor( dispatcher ).from( matcher ).toElement( 'quote' );
 	 *
-	 *		BuildViewConverterFor( dispatcher ).from( { name: 'span', class: 'bold' } ).toAttribute( bold, true );
+	 *		BuildViewConverterFor( dispatcher ).from( { name: 'span', class: 'bold' } ).toAttribute( 'bold', 'true' );
 	 *
 	 * @chainable
 	 * @param {Object|engine.view.Matcher} matcher View matcher or view matcher pattern.
@@ -171,7 +171,7 @@ class ViewConverterBuilder {
 	 *		// span element would not be fired.
 	 *		BuildViewConverterFor( dispatcher )
 	 *			.from( { name: 'span', class: 'bold' } ).consuming( { class: 'bold' } )
-	 *			.toAttribute( { bold: true } );
+	 *			.toAttribute( 'bold', 'true' } );
 	 *
 	 *		BuildViewConverterFor( dispatcher )
 	 *			.fromElement( 'img' ).consuming( { name: true, attributes: [ 'src', 'title' ] } )
@@ -296,7 +296,7 @@ class ViewConverterBuilder {
 	 * representing attribute key and attribute value or a function that returns an object with `key` and `value` properties.
 	 * If you provide creator function, it will be passed converted view element as first and only parameter.
 	 *
-	 *		BuildViewConverterFor( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( 'bold', true );
+	 *		BuildViewConverterFor( dispatcher ).fromAttribute( 'style', { 'font-weight': 'bold' } ).toAttribute( 'bold', 'true' );
 	 *		BuildViewConverterFor( dispatcher )
 	 *			.fromAttribute( 'class' )
 	 *			.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );