diff --git a/js/lib/beautify-html.js b/js/lib/beautify-html.js index f2cfc8dd0..90a14ed66 100644 --- a/js/lib/beautify-html.js +++ b/js/lib/beautify-html.js @@ -405,12 +405,16 @@ this.indent_content = true; this.traverse_whitespace(); } - } else if (tag_check === 'script') { //for later script handling + } else if (tag_check === 'script' && + (tag_complete.search('type') === -1 || + (tag_complete.search('type') > -1 && tag_complete.search('text/javascript') > -1))) { if (!peek) { this.record_tag(tag_check); this.tag_type = 'SCRIPT'; } - } else if (tag_check === 'style') { //for future style handling (for now it justs uses get_content) + } else if (tag_check === 'style' && + (tag_complete.search('type') === -1 || + (tag_complete.search('type') > -1 && tag_complete.search('text/css') > -1))) { if (!peek) { this.record_tag(tag_check); this.tag_type = 'STYLE'; diff --git a/js/test/beautify-tests.js b/js/test/beautify-tests.js index ac3681589..7896880a9 100755 --- a/js/test/beautify-tests.js +++ b/js/test/beautify-tests.js @@ -1701,7 +1701,55 @@ function run_beautifier_tests(test_obj, Urlencoded, js_beautify, html_beautify, '
  • \n' + ' content\n' + '
  • '); - + + // START tests for issue 453 + bth('', + ''); + bth('', + ''); + bth('', + ''); + bth('', + ''); + bth('', + ''); + + bth('', + ''); + bth('', + ''); + bth('', + ''); + bth('', + ''); + bth('', + ''); + // END tests for issue 453 + // Tests that don't pass, but probably should. // bth('
    content
    ');