@@ -379,7 +379,6 @@ function htmlParser( html, handler ) {
379
379
}
380
380
381
381
var hiddenPre = document . createElement ( "pre" ) ;
382
- var spaceRe = / ^ ( \s * ) ( [ \s \S ] * ?) ( \s * ) $ / ;
383
382
/**
384
383
* decodes all entities into regular string
385
384
* @param value
@@ -388,22 +387,11 @@ var spaceRe = /^(\s*)([\s\S]*?)(\s*)$/;
388
387
function decodeEntities ( value ) {
389
388
if ( ! value ) { return '' ; }
390
389
391
- // Note: IE8 does not preserve spaces at the start/end of innerHTML
392
- // so we must capture them and reattach them afterward
393
- var parts = spaceRe . exec ( value ) ;
394
- var spaceBefore = parts [ 1 ] ;
395
- var spaceAfter = parts [ 3 ] ;
396
- var content = parts [ 2 ] ;
397
- if ( content ) {
398
- hiddenPre . innerHTML = content . replace ( / < / g, "<" ) ;
399
- // innerText depends on styling as it doesn't display hidden elements.
400
- // Therefore, it's better to use textContent not to cause unnecessary
401
- // reflows. However, IE<9 don't support textContent so the innerText
402
- // fallback is necessary.
403
- content = 'textContent' in hiddenPre ?
404
- hiddenPre . textContent : hiddenPre . innerText ;
405
- }
406
- return spaceBefore + content + spaceAfter ;
390
+ hiddenPre . innerHTML = value . replace ( / < / g, "<" ) ;
391
+ // innerText depends on styling as it doesn't display hidden elements.
392
+ // Therefore, it's better to use textContent to not cause unnecessary
393
+ // reflows.
394
+ return hiddenPre . textContent ;
407
395
}
408
396
409
397
/**
0 commit comments