Sfoglia il codice sorgente

Improved a comment.

Kamil Piechaczek 7 anni fa
parent
commit
a5f33428bc

+ 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 );