Przeglądaj źródła

Merge branch i/6202-remove-env.isEdge to master.

Internal: Removed mentions on Edge. See ckeditor/ckeditor5#6202.
Piotrek Koszuliński 5 lat temu
rodzic
commit
6cbd5299a6

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

+ 4 - 5
packages/ckeditor5-paste-from-office/tests/data/integration.js

@@ -15,7 +15,6 @@ import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough';
 import List from '@ckeditor/ckeditor5-list/src/list';
 import Image from '@ckeditor/ckeditor5-image/src/image';
 import Table from '@ckeditor/ckeditor5-table/src/table';
-import env from '@ckeditor/ckeditor5-utils/src/env';
 
 import PasteFromOffice from '../../src/pastefromoffice';
 import { generateTests } from '../_utils/utils';
@@ -43,10 +42,10 @@ describe( 'PasteFromOffice - integration', () => {
 			plugins: [ Clipboard, Paragraph, Image, Table, PasteFromOffice ]
 		},
 		skip: {
-			chrome: ( env.isEdge ? [ 'adjacentGroups' ] : [] ),
-			firefox: ( env.isEdge ? [ 'adjacentGroups' ] : [] ),
-			safari: ( env.isEdge ? [ 'adjacentGroups' ] : [] ),
-			edge: ( env.isEdge ? [] : [ 'adjacentGroups' ] )
+			chrome: [],
+			firefox: [],
+			safari: [],
+			edge: [ 'adjacentGroups' ]
 		}
 	} );