diff --git a/index.html b/index.html index ccc044a0f..23c855642 100644 --- a/index.html +++ b/index.html @@ -143,7 +143,13 @@ P_A_C_K_E_R.run_tests(st); Urlencoded.run_tests(st); MyObfuscate.run_tests(st); - var results = st.results_raw().replace(/ /g, ' ').replace(/\r/g, '·').replace(/\n/g, '
'); + var results = st.results_raw() + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/ /g, ' ') + .replace(/\r/g, '·') + .replace(/\n/g, '
'); $('#testresults').html(results).show(); } diff --git a/js/lib/beautify-html.js b/js/lib/beautify-html.js index 90a14ed66..1cd890ab1 100644 --- a/js/lib/beautify-html.js +++ b/js/lib/beautify-html.js @@ -407,7 +407,8 @@ } } else if (tag_check === 'script' && (tag_complete.search('type') === -1 || - (tag_complete.search('type') > -1 && tag_complete.search('text/javascript') > -1))) { + (tag_complete.search('type') > -1 && + tag_complete.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/) > -1))) { if (!peek) { this.record_tag(tag_check); this.tag_type = 'SCRIPT'; diff --git a/js/test/beautify-tests.js b/js/test/beautify-tests.js index 7896880a9..ca4ee756f 100755 --- a/js/test/beautify-tests.js +++ b/js/test/beautify-tests.js @@ -1719,6 +1719,26 @@ function run_beautifier_tests(test_obj, Urlencoded, js_beautify, html_beautify, ''); + bth('', + ''); + bth('', + ''); + bth('', + ''); + bth('', + ''); + bth('', + ''); bth('', '