ampersand as htmlentity "&" returns a false compression

27 views
Skip to first unread message

Thomas Walther

unread,
Feb 3, 2014, 4:22:42 AM2/3/14
to ugli...@googlegroups.com
I have a string width explizit "&" in it.
Now i want to replace this string from "&" to "&" (some use cases have to do it!)

JS uncompressed:

var result = mystring.replace('&','&');

JS compressed width UglifyJS:

var result=mystring.replace('&','&');


Solution:
Split the ampersand and the "amp;" to work fine:
var result = mystring.replace('&'+'amp;','&');


What do you think about this problem/solution?

Is this a bug or a feature?
Do i have to hack the solution like above?

Reply all
Reply to author
Forward
0 new messages