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