@@ -410,7 +410,6 @@ function htmlParser(html, handler) {
410
410
}
411
411
412
412
var hiddenPre = document . createElement ( "pre" ) ;
413
- var spaceRe = / ^ ( \s * ) ( [ \s \S ] * ?) ( \s * ) $ / ;
414
413
/**
415
414
* decodes all entities into regular string
416
415
* @param value
@@ -419,22 +418,11 @@ var spaceRe = /^(\s*)([\s\S]*?)(\s*)$/;
419
418
function decodeEntities ( value ) {
420
419
if ( ! value ) { return '' ; }
421
420
422
- // Note: IE8 does not preserve spaces at the start/end of innerHTML
423
- // so we must capture them and reattach them afterward
424
- var parts = spaceRe . exec ( value ) ;
425
- var spaceBefore = parts [ 1 ] ;
426
- var spaceAfter = parts [ 3 ] ;
427
- var content = parts [ 2 ] ;
428
- if ( content ) {
429
- hiddenPre . innerHTML = content . replace ( / < / g, "<" ) ;
430
- // innerText depends on styling as it doesn't display hidden elements.
431
- // Therefore, it's better to use textContent not to cause unnecessary
432
- // reflows. However, IE<9 don't support textContent so the innerText
433
- // fallback is necessary.
434
- content = 'textContent' in hiddenPre ?
435
- hiddenPre . textContent : hiddenPre . innerText ;
436
- }
437
- return spaceBefore + content + spaceAfter ;
421
+ hiddenPre . innerHTML = value . replace ( / < / g, "<" ) ;
422
+ // innerText depends on styling as it doesn't display hidden elements.
423
+ // Therefore, it's better to use textContent to not cause unnecessary
424
+ // reflows.
425
+ return hiddenPre . textContent ;
438
426
}
439
427
440
428
/**
0 commit comments