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

Docs: for default view to model converters in data controller.

Piotr Jasiun 9 лет назад
Родитель
Сommit
87b660fd8e
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      packages/ckeditor5-engine/src/datacontroller.js

+ 6 - 0
packages/ckeditor5-engine/src/datacontroller.js

@@ -119,6 +119,12 @@ export default class DataController {
 		this.viewToModel = new ViewConversionDispatcher( {
 			schema: modelDocument.schema
 		} );
+
+		// Define default converters for text and elements.
+		//
+		// Note that if there is no default converter for the element it will be skipped, for instance `<b>foo</b>` will be
+		// converted to nothing. We add `convertToModelFragment` as a last converter so it converts children of that
+		// element to the document fragment so `<b>foo</b>` will be converted to `foo` if there is no converter for `<b>`.
 		this.viewToModel.on( 'text', convertText() );
 		this.viewToModel.on( 'element', convertToModelFragment(), null, 9999 );
 		this.viewToModel.on( 'documentFragment', convertToModelFragment(), null, 9999 );