diff --git a/src/ngSanitize/sanitize.js b/src/ngSanitize/sanitize.js index 5d378b02cac3..ea9de7b7f1a5 100644 --- a/src/ngSanitize/sanitize.js +++ b/src/ngSanitize/sanitize.js @@ -373,11 +373,11 @@ function decodeEntities(value) { // Note: IE8 does not preserve spaces at the start/end of innerHTML var spaceRe = /^(\s*)([\s\S]*?)(\s*)$/; var parts = spaceRe.exec(value); - parts[0] = ''; if (parts[2]) { hiddenPre.innerHTML=parts[2].replace(/&c')).toEqual('a<div>&</div>c'); }); }); + + describe('decodeEntities', function() { + it('should not prepend the original string to the output', function() { + expect(decodeEntities('John Due ☺')).toEqual('John Due ☺'); + }); + }); });