瀏覽代碼

Improved a comment.

Kamil Piechaczek 7 年之前
父節點
當前提交
a5f33428bc
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/ckeditor5-engine/src/model/utils/modifyselection.js

+ 1 - 1
packages/ckeditor5-engine/src/model/utils/modifyselection.js

@@ -172,7 +172,7 @@ function getCorrectWordBreakPosition( walker, isForward ) {
 			// should expand to : 'foofoo [bar<$text bold="true">bar</$text>] bazbaz'.
 			const nextNode = isForward ? walker.position.nodeAfter : walker.position.nodeBefore;
 
-			// `nextNode` can be an inline element which is an invalid node in this case.
+			// Scan only text nodes. Ignore inline elements (like `<softBreak>`).
 			if ( nextNode && nextNode.is( 'text' ) ) {
 				// Check boundary char of an adjacent text node.
 				const boundaryChar = nextNode.data.charAt( isForward ? 0 : nextNode.data.length - 1 );