8
0
Просмотр исходного кода

Docs: Made it clear which writer is needed. [skip ci]

Piotrek Koszuliński 7 лет назад
Родитель
Сommit
612e8c1792

+ 4 - 2
packages/ckeditor5-engine/src/conversion/downcast-converters.js

@@ -47,7 +47,8 @@ import { cloneDeep } from 'lodash-es';
  * @param {Object} config Conversion configuration.
  * @param {String} config.model The name of the model element to convert.
  * @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
- * that takes the model element and view writer as parameters and returns a view container element.
+ * that takes the model element and {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer}
+ * as parameters and returns a view container element.
  * @returns {Function} Conversion helper.
  */
 export function downcastElementToElement( config ) {
@@ -123,7 +124,8 @@ export function downcastElementToElement( config ) {
  * @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array
  * of `String`s with possible values if the model attribute is an enumerable.
  * @param {module:engine/view/elementdefinition~ElementDefinition|Function|Object} config.view A view element definition or a function
- * that takes the model attribute value and view writer as parameters and returns a view attribute element. If `config.model.values` is
+ * that takes the model attribute value and {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer}
+ * as parameters and returns a view attribute element. If `config.model.values` is
  * given, `config.view` should be an object assigning values from `config.model.values` to view element definitions or functions.
  * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  * @returns {Function} Conversion helper.

+ 5 - 5
packages/ckeditor5-engine/src/view/downcastwriter.js

@@ -146,7 +146,7 @@ export default class DowncastWriter {
 	 * Creates new {@link module:engine/view/attributeelement~AttributeElement}.
 	 *
 	 *		writer.createAttributeElement( 'strong' );
-	 *		writer.createAttributeElement( 'strong', { 'alignment': 'center' } );
+	 *		writer.createAttributeElement( 'strong', { alignment: 'center' } );
 	 *
 	 *		// Make `<a>` element contain other attributes element so the `<a>` element is not broken.
 	 *		writer.createAttributeElement( 'a', { href: 'foo.bar' }, { priority: 5 } );
@@ -179,7 +179,7 @@ export default class DowncastWriter {
 	 * Creates new {@link module:engine/view/containerelement~ContainerElement}.
 	 *
 	 *		writer.createContainerElement( 'paragraph' );
-	 *		writer.createContainerElement( 'paragraph', { 'alignment': 'center' } );
+	 *		writer.createContainerElement( 'paragraph', { alignment: 'center' } );
 	 *
 	 * @param {String} name Name of the element.
 	 * @param {Object} [attributes] Elements attributes.
@@ -193,7 +193,7 @@ export default class DowncastWriter {
 	 * Creates new {@link module:engine/view/editableelement~EditableElement}.
 	 *
 	 *		writer.createEditableElement( 'div' );
-	 *		writer.createEditableElement( 'div', { 'alignment': 'center' } );
+	 *		writer.createEditableElement( 'div', { alignment: 'center' } );
 	 *
 	 * @param {String} name Name of the element.
 	 * @param {Object} [attributes] Elements attributes.
@@ -210,7 +210,7 @@ export default class DowncastWriter {
 	 * Creates new {@link module:engine/view/emptyelement~EmptyElement}.
 	 *
 	 *		writer.createEmptyElement( 'img' );
-	 *		writer.createEmptyElement( 'img', { 'alignment': 'center' } );
+	 *		writer.createEmptyElement( 'img', { alignment: 'center' } );
 	 *
 	 * @param {String} name Name of the element.
 	 * @param {Object} [attributes] Elements attributes.
@@ -224,7 +224,7 @@ export default class DowncastWriter {
 	 * Creates new {@link module:engine/view/uielement~UIElement}.
 	 *
 	 *		writer.createUIElement( 'span' );
-	 *		writer.createUIElement( 'span', { 'alignment': 'center' } );
+	 *		writer.createUIElement( 'span', { alignment: 'center' } );
 	 *
 	 * Custom render function can be provided as third parameter:
 	 *