Procházet zdrojové kódy

Other: Remove the complicated innerText.length calculations, required due to old Edge quirks. ckeditor/ckeditor5#6202.

Agreed at https://github.com/ckeditor/ckeditor5-utils/pull/333#issuecomment-615275702
Tomek Wytrębowicz před 5 roky
rodič
revize
e8523de3d7

+ 1 - 6
packages/ckeditor5-paste-from-office/src/filters/space.js

@@ -39,12 +39,7 @@ export function normalizeSpacing( htmlString ) {
  */
 export function normalizeSpacerunSpans( htmlDocument ) {
 	htmlDocument.querySelectorAll( 'span[style*=spacerun]' ).forEach( el => {
-		// Use `el.childNodes[ 0 ].data.length` instead of `el.innerText.length`. For `el.innerText.length` which
-		// contains spaces mixed with ` ` Edge browser returns incorrect length.
-		const innerTextLength = ( el.childNodes &&
-			el.childNodes[ 0 ] &&
-			el.childNodes[ 0 ].data &&
-			el.childNodes[ 0 ].data.length ) || 0;
+		const innerTextLength = el.innerText.length || 0;
 
 		el.innerHTML = Array( innerTextLength + 1 ).join( '\u00A0 ' ).substr( 0, innerTextLength );
 	} );