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

All converter in basic styles are attribute to element converters.

Piotr Jasiun 8 лет назад
Родитель
Сommit
91218cf370

+ 2 - 2
packages/ckeditor5-basic-styles/src/boldengine.js

@@ -9,7 +9,7 @@
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import { downcastAttributeToElement } from '@ckeditor/ckeditor5-engine/src/conversion/downcast-converters';
-import { upcastElementToAttribute, upcastAttributeToAttribute } from '@ckeditor/ckeditor5-engine/src/conversion/upcast-converters';
+import { upcastElementToAttribute } from '@ckeditor/ckeditor5-engine/src/conversion/upcast-converters';
 import AttributeCommand from './attributecommand';
 
 const BOLD = 'bold';
@@ -40,7 +40,7 @@ export default class BoldEngine extends Plugin {
 		editor.conversion.for( 'upcast' )
 			.add( upcastElementToAttribute( { view: 'b', model: BOLD } ) )
 			.add( upcastElementToAttribute( { view: 'strong', model: BOLD } ) )
-			.add( upcastAttributeToAttribute( { view: { style: { 'font-weight': 'bold' } }, model: BOLD } ) );
+			.add( upcastElementToAttribute( { view: { style: { 'font-weight': 'bold' } }, model: BOLD } ) );
 
 		// Create bold command.
 		editor.commands.add( BOLD, new AttributeCommand( editor, BOLD ) );

+ 2 - 2
packages/ckeditor5-basic-styles/src/codeengine.js

@@ -9,7 +9,7 @@
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import { downcastAttributeToElement } from '@ckeditor/ckeditor5-engine/src/conversion/downcast-converters';
-import { upcastElementToAttribute, upcastAttributeToAttribute } from '@ckeditor/ckeditor5-engine/src/conversion/upcast-converters';
+import { upcastElementToAttribute } from '@ckeditor/ckeditor5-engine/src/conversion/upcast-converters';
 import AttributeCommand from './attributecommand';
 
 const CODE = 'code';
@@ -39,7 +39,7 @@ export default class CodeEngine extends Plugin {
 		// Build converter from view to model for data pipeline.
 		editor.conversion.for( 'upcast' )
 			.add( upcastElementToAttribute( { view: 'code', model: CODE } ) )
-			.add( upcastAttributeToAttribute( { view: { style: { 'word-wrap': 'break-word' } }, model: CODE } ) );
+			.add( upcastElementToAttribute( { view: { style: { 'word-wrap': 'break-word' } }, model: CODE } ) );
 
 		// Create code command.
 		editor.commands.add( CODE, new AttributeCommand( editor, CODE ) );

+ 2 - 2
packages/ckeditor5-basic-styles/src/italicengine.js

@@ -9,7 +9,7 @@
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import { downcastAttributeToElement } from '@ckeditor/ckeditor5-engine/src/conversion/downcast-converters';
-import { upcastElementToAttribute, upcastAttributeToAttribute } from '@ckeditor/ckeditor5-engine/src/conversion/upcast-converters';
+import { upcastElementToAttribute } from '@ckeditor/ckeditor5-engine/src/conversion/upcast-converters';
 import AttributeCommand from './attributecommand';
 
 const ITALIC = 'italic';
@@ -40,7 +40,7 @@ export default class ItalicEngine extends Plugin {
 		editor.conversion.for( 'upcast' )
 			.add( upcastElementToAttribute( { view: 'em', model: ITALIC } ) )
 			.add( upcastElementToAttribute( { view: 'i', model: ITALIC } ) )
-			.add( upcastAttributeToAttribute( { view: { style: { 'font-style': 'italic' } }, model: ITALIC } ) );
+			.add( upcastElementToAttribute( { view: { style: { 'font-style': 'italic' } }, model: ITALIC } ) );
 
 		// Create italic command.
 		editor.commands.add( ITALIC, new AttributeCommand( editor, ITALIC ) );

+ 2 - 2
packages/ckeditor5-basic-styles/src/strikethroughengine.js

@@ -9,7 +9,7 @@
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import { downcastAttributeToElement } from '@ckeditor/ckeditor5-engine/src/conversion/downcast-converters';
-import { upcastElementToAttribute, upcastAttributeToAttribute } from '@ckeditor/ckeditor5-engine/src/conversion/upcast-converters';
+import { upcastElementToAttribute } from '@ckeditor/ckeditor5-engine/src/conversion/upcast-converters';
 import AttributeCommand from './attributecommand';
 
 const STRIKETHROUGH = 'strikethrough';
@@ -42,7 +42,7 @@ export default class StrikethroughEngine extends Plugin {
 			.add( upcastElementToAttribute( { view: 's', model: STRIKETHROUGH } ) )
 			.add( upcastElementToAttribute( { view: 'del', model: STRIKETHROUGH } ) )
 			.add( upcastElementToAttribute( { view: 'strike', model: STRIKETHROUGH } ) )
-			.add( upcastAttributeToAttribute( { view: { style: { 'text-decoration': 'line-through' } }, model: STRIKETHROUGH } ) );
+			.add( upcastElementToAttribute( { view: { style: { 'text-decoration': 'line-through' } }, model: STRIKETHROUGH } ) );
 
 		// Create strikethrough command.
 		editor.commands.add( STRIKETHROUGH, new AttributeCommand( editor, STRIKETHROUGH ) );

+ 2 - 2
packages/ckeditor5-basic-styles/src/underlineengine.js

@@ -9,7 +9,7 @@
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import { downcastAttributeToElement } from '@ckeditor/ckeditor5-engine/src/conversion/downcast-converters';
-import { upcastElementToAttribute, upcastAttributeToAttribute } from '@ckeditor/ckeditor5-engine/src/conversion/upcast-converters';
+import { upcastElementToAttribute } from '@ckeditor/ckeditor5-engine/src/conversion/upcast-converters';
 import AttributeCommand from './attributecommand';
 
 const UNDERLINE = 'underline';
@@ -39,7 +39,7 @@ export default class UnderlineEngine extends Plugin {
 		// Build converter from view to model for data pipeline.
 		editor.conversion.for( 'upcast' )
 			.add( upcastElementToAttribute( { view: 'u', model: UNDERLINE } ) )
-			.add( upcastAttributeToAttribute( { view: { style: { 'text-decoration': 'underline' } }, model: UNDERLINE } ) );
+			.add( upcastElementToAttribute( { view: { style: { 'text-decoration': 'underline' } }, model: UNDERLINE } ) );
 
 		// Create underline command.
 		editor.commands.add( UNDERLINE, new AttributeCommand( editor, UNDERLINE ) );