浏览代码

Docs: Expanded inline comment.

Szymon Cofalik 7 年之前
父节点
当前提交
8fb33df652
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      packages/ckeditor5-engine/src/view/domconverter.js

+ 4 - 2
packages/ckeditor5-engine/src/view/domconverter.js

@@ -982,8 +982,10 @@ export default class DomConverter {
 			data = data.replace( / $/, '' );
 		}
 
-		// Firefox inserts whitespace and <br> instead of non-breaking space. To prevent normal space from
-		// being removed inline filler is removed after first string replaces. See ckeditor5#692.
+		// At the beginning and end of a block element, Firefox inserts normal space + <br> instead of non-breaking space.
+		// This means that the text node starts/end with normal space instead of non-breaking space.
+		// This causes a problem because the normal space would be removed in `.replace` calls above. To prevent that,
+		// the inline filler is removed only after the data is initially processed (by the `.replace` above). See ckeditor5#692.
 		data = getDataWithoutFiller( new Text( data ) );
 
 		// At this point we should have removed all whitespaces from DOM text data.