@@ -623,7 +623,7 @@ QUnit.test('collapsing space in conditional comments', function(assert) {
623623 } ) , output ) ;
624624} ) ;
625625
626- QUnit . test ( '(bug) CDATA parsed as conditional comments' , function ( assert ) {
626+ QUnit . test ( 'treat CDATA like a comments for backward compatibility ' , function ( assert ) {
627627 var input ;
628628
629629 input = '<![CDATA[line 1\nline 2]]>' ;
@@ -633,21 +633,13 @@ QUnit.test('(bug) CDATA parsed as conditional comments', function(assert) {
633633 assert . equal ( minify ( input ) , input ) ;
634634 assert . equal ( minify ( input , { removeComments : true } ) , '<p></p>' ) ;
635635
636- // https://github.com/kangax/html-minifier/issues/1161
636+ // // https://github.com/kangax/html-minifier/issues/1161
637637 input = '<![CDATA[___]><-___]]>' ;
638- assert . throws ( function ( ) {
639- minify ( input ) ;
640- } , '"]>" treated as end instead of "]]>" (bug)' ) ;
641- assert . throws ( function ( ) {
642- minify ( input , { removeComments : true } ) ;
643- } , '"]>" treated as end instead of "]]>" (bug)' ) ;
638+ assert . equal ( minify ( input ) , input ) ;
639+ assert . equal ( minify ( input , { removeComments : true } ) , '' ) ;
644640 input = '<p><![CDATA[___]><-___]]></p>' ;
645- assert . throws ( function ( ) {
646- minify ( input ) ;
647- } , '"]>" treated as end instead of "]]>" (bug)' ) ;
648- assert . throws ( function ( ) {
649- minify ( input , { removeComments : true } ) ;
650- } , '"]>" treated as end instead of "]]>" (bug)' ) ;
641+ assert . equal ( minify ( input ) , input ) ;
642+ assert . equal ( minify ( input , { removeComments : true } ) , '<p></p>' ) ;
651643} ) ;
652644
653645QUnit . test ( 'remove comments from scripts' , function ( assert ) {
0 commit comments