gruntjs / grunt-contrib-uglify

Minify files with UglifyJS.
http://gruntjs.com/
MIT License
1.48k stars 347 forks source link

closing script tag (</SCRIPT>), is changed to lower case (<\/script>). #488

Closed akgoyal1987 closed 7 years ago

akgoyal1987 commented 7 years ago

closing script tag (), is changed to lower case (<\/script>) after running grunt uglify. here is the code :

        var test = function (coId, calObj, dimId, isForAllMembers) {
            var xml = '';
            xml += '<SCRIPT>';
            xml += '<EXPRESSION>';
            xml += '<CALC_MEMS>';
            xml += '</CALC_MEMS>';
            xml += '</EXPRESSION>';
            xml += '</SCRIPT>';
            return xml;
        };

and the result is :

var test=function(){var e="";return e+="<SCRIPT>",e+="<EXPRESSION>",e+="<CALC_MEMS>",e+="</CALC_MEMS>",e+="</EXPRESSION>",e+="<\/script>"};

here closing is changed to <\/script>

this is causing error in XML parsing.

this is happening only with closing SCRIPT Tag.

Please provide solution for this problem.

Thanks :) Ankit Goyal

XhmikosR commented 7 years ago

And what makes you think this isn't an upstream issue? Doesn't it happen with uglify itself?

akgoyal1987 commented 7 years ago

@XhmikosR , it may be upstream issue, I didn't check, I accept that this is my fault. as I found this when I was uglifying my code using grunt-contrib-uglify, I reported it here. I will check this with uglify-js.

Thanks.

alexlamsl commented 7 years ago

@akgoyal1987 in case this may address your issue - uglify-js does </script> escaping if inline_script is enabled.

In the future please file the issue directly on https://github.com/mishoo/UglifyJS2/issues so I can notice it sooner.