8
0
Krzysztof Krztoń vor 6 Jahren
Ursprung
Commit
284bb62135

+ 5 - 3
packages/ckeditor5-engine/src/controller/datacontroller.js

@@ -117,8 +117,10 @@ export default class DataController {
 	 * @returns {String} Output data.
 	 */
 	get( options ) {
-		const rootName = ( options || {} ).rootName || 'main';
-		const trim = ( options || {} ).trim || 'empty';
+		options = options || {};
+
+		const rootName = options.rootName || 'main';
+		const trim = options.trim || 'empty';
 
 		if ( !this._checkIfRootsExists( [ rootName ] ) ) {
 			/**
@@ -152,7 +154,7 @@ export default class DataController {
 	 */
 	stringify( modelElementOrFragment, skipEmpty = false ) {
 		if ( skipEmpty && this.model.isEmpty( modelElementOrFragment ) ) {
-			// If trimEmpty is true && model is considered empty return empty string.
+			// If skipEmpty and model is considered empty return empty string.
 			return '';
 		} else {
 			// Model -> view.

+ 1 - 2
packages/ckeditor5-engine/src/model/model.js

@@ -499,7 +499,7 @@ export default class Model {
 			return true;
 		}
 
-		// Check if there are any markers which affects data in a given range.
+		// Check if there are any markers which affects data in this given range.
 		for ( const intersectingMarker of this.markers.getMarkersIntersectingRange( rangeOrElement ) ) {
 			if ( intersectingMarker.affectsData ) {
 				return false;
@@ -507,7 +507,6 @@ export default class Model {
 		}
 
 		for ( const item of rangeOrElement.getItems() ) {
-			// Remember, `TreeWalker` returns always `textProxy` nodes.
 			if ( item.is( 'textProxy' ) && item.data.match( /\S+/gi ) !== null ) {
 				return false;
 			} else if ( this.schema.isObject( item ) || item.is( 'emptyElement' ) ) {