Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Reverted changes that should not be committed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Piechaczek committed Apr 4, 2018
1 parent 05adc46 commit bafd635
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/conversion/downcast-converters.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ export function removeUIElement() {
* The converter automatically consumes corresponding value from consumables list and stops the event (see
* {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
*
* modelDispatcher.on( 'attributes:customAttr:myElem', changeAttribute( ( value, data ) => {
* modelDispatcher.on( 'attribute:customAttr:myElem', changeAttribute( ( value, data ) => {
* // Change attribute key from `customAttr` to `class` in view.
* const key = 'class';
* let value = data.attributeNewValue;
Expand Down Expand Up @@ -738,7 +738,7 @@ export function changeAttribute( attributeCreator ) {
* The converter automatically consumes corresponding value from consumables list, stops the event (see
* {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
*
* modelDispatcher.on( 'attributes:bold', wrapItem( ( modelAttributeValue, viewWriter ) => {
* modelDispatcher.on( 'attribute:bold', wrapItem( ( modelAttributeValue, viewWriter ) => {
* return viewWriter.createAttributeElement( 'strong' );
* } );
*
Expand Down
4 changes: 2 additions & 2 deletions src/conversion/modelconsumable.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import TextProxy from '../model/textproxy';
* during conversion, when given part of model item is converted (i.e. the view element has been inserted into the view,
* but without attributes), consumable value is removed from `ModelConsumable`.
*
* For model items, `ModelConsumable` stores consumable values of one of following types: `insert`, `addattributes:<attributeKey>`,
* For model items, `ModelConsumable` stores consumable values of one of following types: `insert`, `addattribute:<attributeKey>`,
* `changeattributes:<attributeKey>`, `removeattributes:<attributeKey>`.
*
* In most cases, it is enough to let {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}
Expand Down Expand Up @@ -312,7 +312,7 @@ export default class ModelConsumable {

// Returns a normalized consumable type name from given string. A normalized consumable type name is a string that has
// at most one colon, for example: `insert` or `addMarker:highlight`. If string to normalize has more "parts" (more colons),
// the other parts are dropped, for example: `addattributes:bold:$text` -> `addattributes:bold`.
// the other parts are dropped, for example: `addattribute:bold:$text` -> `addattributes:bold`.
//
// @param {String} type Consumable type.
// @returns {String} Normalized consumable type.
Expand Down
2 changes: 1 addition & 1 deletion src/conversion/viewconsumable.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ class ViewElementConsumables {
*
* @error viewconsumable-invalid-attribute
*/
throw new CKEditorError( 'viewconsumable-invalid-attributes: Classes and styles should be handled separately.' );
throw new CKEditorError( 'viewconsumable-invalid-attribute: Classes and styles should be handled separately.' );
}

consumables.set( name, true );
Expand Down
2 changes: 1 addition & 1 deletion tests/conversion/downcast-converters.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ describe( 'downcast-converters', () => {
const modelElement = new ModelElement( 'paragraph', { classes: 'foo' }, new ModelText( 'foobar' ) );

dispatcher.on( 'attribute:class', ( evt, data, conversionApi ) => {
conversionApi.consumable.consume( data.item, 'attributes:class' );
conversionApi.consumable.consume( data.item, 'attribute:class' );
}, { priority: 'high' } );

model.change( writer => {
Expand Down

0 comments on commit bafd635

Please sign in to comment.