浏览代码

Docs: Added more explanation to a comment.

Szymon Cofalik 8 年之前
父节点
当前提交
d84edc4339
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      packages/ckeditor5-engine/src/conversion/model-selection-to-view-converters.js

+ 2 - 0
packages/ckeditor5-engine/src/conversion/model-selection-to-view-converters.js

@@ -203,6 +203,8 @@ function wrapCollapsedSelectionPosition( modelSelection, viewSelection, viewElem
 
 
 	// This hack is supposed to place attribute element *after* all ui elements if the attribute element would be
 	// This hack is supposed to place attribute element *after* all ui elements if the attribute element would be
 	// the only non-ui child and thus receive a block filler.
 	// the only non-ui child and thus receive a block filler.
+	// This is needed to properly render ui elements. Block filler is a <br /> element. If it is placed before
+	// UI element, the ui element will most probably be incorrectly rendered (in next line). #1072.
 	if ( shouldPushAttributeElement( viewPosition.parent ) ) {
 	if ( shouldPushAttributeElement( viewPosition.parent ) ) {
 		viewPosition = viewPosition.getLastMatchingPosition( value => value.item.is( 'uiElement' ) );
 		viewPosition = viewPosition.getLastMatchingPosition( value => value.item.is( 'uiElement' ) );
 	}
 	}