htmlcompressor 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE +13 -0
  4. data/README.md +83 -0
  5. data/Rakefile +2 -0
  6. data/htmlcompressor.gemspec +21 -0
  7. data/lib/htmlcompressor.rb +6 -0
  8. data/lib/htmlcompressor/compressor.rb +785 -0
  9. data/lib/htmlcompressor/rack.rb +54 -0
  10. data/lib/htmlcompressor/version.rb +3 -0
  11. data/test/compressor_test.rb +254 -0
  12. data/test/resources/html/.svn/all-wcprops +275 -0
  13. data/test/resources/html/.svn/entries +1558 -0
  14. data/test/resources/html/.svn/prop-base/testRemoveHttpProtocol.html.svn-base +5 -0
  15. data/test/resources/html/.svn/prop-base/testRemoveHttpProtocolResult.html.svn-base +5 -0
  16. data/test/resources/html/.svn/prop-base/testRemoveHttpsProtocol.html.svn-base +5 -0
  17. data/test/resources/html/.svn/prop-base/testRemoveHttpsProtocolResult.html.svn-base +5 -0
  18. data/test/resources/html/.svn/prop-base/testRemoveSpacesInsideTags.html.svn-base +5 -0
  19. data/test/resources/html/.svn/prop-base/testRemoveSpacesInsideTagsResult.html.svn-base +5 -0
  20. data/test/resources/html/.svn/prop-base/testSurroundingSpaces.html.svn-base +5 -0
  21. data/test/resources/html/.svn/prop-base/testSurroundingSpacesResult.html.svn-base +5 -0
  22. data/test/resources/html/.svn/text-base/testCompress.html.svn-base +10 -0
  23. data/test/resources/html/.svn/text-base/testCompressCss.html.svn-base +11 -0
  24. data/test/resources/html/.svn/text-base/testCompressCssResult.html.svn-base +6 -0
  25. data/test/resources/html/.svn/text-base/testCompressJavaScript.html.svn-base +24 -0
  26. data/test/resources/html/.svn/text-base/testCompressJavaScriptClosureResult.html.svn-base +7 -0
  27. data/test/resources/html/.svn/text-base/testCompressJavaScriptYuiResult.html.svn-base +7 -0
  28. data/test/resources/html/.svn/text-base/testCompressResult.html.svn-base +1 -0
  29. data/test/resources/html/.svn/text-base/testEnabled.html.svn-base +1 -0
  30. data/test/resources/html/.svn/text-base/testEnabledResult.html.svn-base +1 -0
  31. data/test/resources/html/.svn/text-base/testPreserveLineBreaks.html.svn-base +11 -0
  32. data/test/resources/html/.svn/text-base/testPreserveLineBreaksResult.html.svn-base +5 -0
  33. data/test/resources/html/.svn/text-base/testPreservePatterns.html.svn-base +7 -0
  34. data/test/resources/html/.svn/text-base/testPreservePatternsResult.html.svn-base +1 -0
  35. data/test/resources/html/.svn/text-base/testRemoveComments.html.svn-base +17 -0
  36. data/test/resources/html/.svn/text-base/testRemoveCommentsResult.html.svn-base +4 -0
  37. data/test/resources/html/.svn/text-base/testRemoveFormAttributes.html.svn-base +1 -0
  38. data/test/resources/html/.svn/text-base/testRemoveFormAttributesResult.html.svn-base +1 -0
  39. data/test/resources/html/.svn/text-base/testRemoveHttpProtocol.html.svn-base +1 -0
  40. data/test/resources/html/.svn/text-base/testRemoveHttpProtocolResult.html.svn-base +1 -0
  41. data/test/resources/html/.svn/text-base/testRemoveHttpsProtocol.html.svn-base +1 -0
  42. data/test/resources/html/.svn/text-base/testRemoveHttpsProtocolResult.html.svn-base +1 -0
  43. data/test/resources/html/.svn/text-base/testRemoveInputAttributes.html.svn-base +1 -0
  44. data/test/resources/html/.svn/text-base/testRemoveInputAttributesResult.html.svn-base +1 -0
  45. data/test/resources/html/.svn/text-base/testRemoveIntertagSpaces.html.svn-base +5 -0
  46. data/test/resources/html/.svn/text-base/testRemoveIntertagSpacesResult.html.svn-base +1 -0
  47. data/test/resources/html/.svn/text-base/testRemoveJavaScriptProtocol.html.svn-base +1 -0
  48. data/test/resources/html/.svn/text-base/testRemoveJavaScriptProtocolResult.html.svn-base +1 -0
  49. data/test/resources/html/.svn/text-base/testRemoveLinkAttributes.html.svn-base +5 -0
  50. data/test/resources/html/.svn/text-base/testRemoveLinkAttributesResult.html.svn-base +1 -0
  51. data/test/resources/html/.svn/text-base/testRemoveMultiSpaces.html.svn-base +1 -0
  52. data/test/resources/html/.svn/text-base/testRemoveMultiSpacesResult.html.svn-base +1 -0
  53. data/test/resources/html/.svn/text-base/testRemoveQuotes.html.svn-base +7 -0
  54. data/test/resources/html/.svn/text-base/testRemoveQuotesResult.html.svn-base +1 -0
  55. data/test/resources/html/.svn/text-base/testRemoveScriptAttributes.html.svn-base +6 -0
  56. data/test/resources/html/.svn/text-base/testRemoveScriptAttributesResult.html.svn-base +1 -0
  57. data/test/resources/html/.svn/text-base/testRemoveSpacesInsideTags.html.svn-base +1 -0
  58. data/test/resources/html/.svn/text-base/testRemoveSpacesInsideTagsResult.html.svn-base +1 -0
  59. data/test/resources/html/.svn/text-base/testRemoveStyleAttributes.html.svn-base +3 -0
  60. data/test/resources/html/.svn/text-base/testRemoveStyleAttributesResult.html.svn-base +1 -0
  61. data/test/resources/html/.svn/text-base/testSimpleBooleanAttributes.html.svn-base +1 -0
  62. data/test/resources/html/.svn/text-base/testSimpleBooleanAttributesResult.html.svn-base +1 -0
  63. data/test/resources/html/.svn/text-base/testSimpleDoctype.html.svn-base +2 -0
  64. data/test/resources/html/.svn/text-base/testSimpleDoctypeResult.html.svn-base +1 -0
  65. data/test/resources/html/.svn/text-base/testSurroundingSpaces.html.svn-base +1 -0
  66. data/test/resources/html/.svn/text-base/testSurroundingSpacesResult.html.svn-base +1 -0
  67. data/test/resources/html/testCompress.html +10 -0
  68. data/test/resources/html/testCompressCss.html +11 -0
  69. data/test/resources/html/testCompressCssResult.html +6 -0
  70. data/test/resources/html/testCompressJavaScript.html +24 -0
  71. data/test/resources/html/testCompressJavaScriptClosureResult.html +7 -0
  72. data/test/resources/html/testCompressJavaScriptYuiResult.html +7 -0
  73. data/test/resources/html/testCompressResult.html +1 -0
  74. data/test/resources/html/testEnabled.html +1 -0
  75. data/test/resources/html/testEnabledResult.html +1 -0
  76. data/test/resources/html/testPreserveLineBreaks.html +11 -0
  77. data/test/resources/html/testPreserveLineBreaksResult.html +5 -0
  78. data/test/resources/html/testPreservePatterns.html +7 -0
  79. data/test/resources/html/testPreservePatternsResult.html +1 -0
  80. data/test/resources/html/testRemoveComments.html +17 -0
  81. data/test/resources/html/testRemoveCommentsResult.html +4 -0
  82. data/test/resources/html/testRemoveFormAttributes.html +1 -0
  83. data/test/resources/html/testRemoveFormAttributesResult.html +1 -0
  84. data/test/resources/html/testRemoveHttpProtocol.html +1 -0
  85. data/test/resources/html/testRemoveHttpProtocolResult.html +1 -0
  86. data/test/resources/html/testRemoveHttpsProtocol.html +1 -0
  87. data/test/resources/html/testRemoveHttpsProtocolResult.html +1 -0
  88. data/test/resources/html/testRemoveInputAttributes.html +1 -0
  89. data/test/resources/html/testRemoveInputAttributesResult.html +1 -0
  90. data/test/resources/html/testRemoveIntertagSpaces.html +5 -0
  91. data/test/resources/html/testRemoveIntertagSpacesResult.html +1 -0
  92. data/test/resources/html/testRemoveJavaScriptProtocol.html +1 -0
  93. data/test/resources/html/testRemoveJavaScriptProtocolResult.html +1 -0
  94. data/test/resources/html/testRemoveLinkAttributes.html +5 -0
  95. data/test/resources/html/testRemoveLinkAttributesResult.html +1 -0
  96. data/test/resources/html/testRemoveMultiSpaces.html +1 -0
  97. data/test/resources/html/testRemoveMultiSpacesResult.html +1 -0
  98. data/test/resources/html/testRemoveQuotes.html +7 -0
  99. data/test/resources/html/testRemoveQuotesResult.html +1 -0
  100. data/test/resources/html/testRemoveScriptAttributes.html +6 -0
  101. data/test/resources/html/testRemoveScriptAttributesResult.html +1 -0
  102. data/test/resources/html/testRemoveSpacesInsideTags.html +1 -0
  103. data/test/resources/html/testRemoveSpacesInsideTagsResult.html +1 -0
  104. data/test/resources/html/testRemoveStyleAttributes.html +3 -0
  105. data/test/resources/html/testRemoveStyleAttributesResult.html +1 -0
  106. data/test/resources/html/testSimpleBooleanAttributes.html +1 -0
  107. data/test/resources/html/testSimpleBooleanAttributesResult.html +1 -0
  108. data/test/resources/html/testSimpleDoctype.html +2 -0
  109. data/test/resources/html/testSimpleDoctypeResult.html +1 -0
  110. data/test/resources/html/testSurroundingSpaces.html +1 -0
  111. data/test/resources/html/testSurroundingSpacesResult.html +1 -0
  112. data/test/resources/xml/.svn/all-wcprops +53 -0
  113. data/test/resources/xml/.svn/entries +300 -0
  114. data/test/resources/xml/.svn/text-base/testCompress.xml.svn-base +11 -0
  115. data/test/resources/xml/.svn/text-base/testCompressResult.xml.svn-base +5 -0
  116. data/test/resources/xml/.svn/text-base/testEnabled.xml.svn-base +1 -0
  117. data/test/resources/xml/.svn/text-base/testEnabledResult.xml.svn-base +1 -0
  118. data/test/resources/xml/.svn/text-base/testRemoveComments.xml.svn-base +5 -0
  119. data/test/resources/xml/.svn/text-base/testRemoveCommentsResult.xml.svn-base +4 -0
  120. data/test/resources/xml/.svn/text-base/testRemoveIntertagSpaces.xml.svn-base +11 -0
  121. data/test/resources/xml/.svn/text-base/testRemoveIntertagSpacesResult.xml.svn-base +5 -0
  122. data/test/resources/xml/testCompress.xml +11 -0
  123. data/test/resources/xml/testCompressResult.xml +5 -0
  124. data/test/resources/xml/testEnabled.xml +1 -0
  125. data/test/resources/xml/testEnabledResult.xml +1 -0
  126. data/test/resources/xml/testRemoveComments.xml +5 -0
  127. data/test/resources/xml/testRemoveCommentsResult.xml +4 -0
  128. data/test/resources/xml/testRemoveIntertagSpaces.xml +11 -0
  129. data/test/resources/xml/testRemoveIntertagSpacesResult.xml +5 -0
  130. metadata +332 -0
@@ -0,0 +1,5 @@
1
+ K 13
2
+ svn:mime-type
3
+ V 9
4
+ text/html
5
+ END
@@ -0,0 +1,5 @@
1
+ K 13
2
+ svn:mime-type
3
+ V 9
4
+ text/html
5
+ END
@@ -0,0 +1,5 @@
1
+ K 13
2
+ svn:mime-type
3
+ V 9
4
+ text/html
5
+ END
@@ -0,0 +1,5 @@
1
+ K 13
2
+ svn:mime-type
3
+ V 9
4
+ text/html
5
+ END
@@ -0,0 +1,5 @@
1
+ K 13
2
+ svn:mime-type
3
+ V 9
4
+ text/html
5
+ END
@@ -0,0 +1,5 @@
1
+ K 13
2
+ svn:mime-type
3
+ V 9
4
+ text/html
5
+ END
@@ -0,0 +1,5 @@
1
+ K 13
2
+ svn:mime-type
3
+ V 9
4
+ text/html
5
+ END
@@ -0,0 +1,10 @@
1
+ <a x="aaa 'bbb' ccc" b="1"> <b onclick = " alert('<a> <b>') " /> <c/>
2
+ <d />
3
+ <pre a = " 1 "> <x /> <y> </pre>
4
+ <!-- comment -->
5
+ <!--[if lt IE 7 ]> <body class="ie6"> <![endif]--> <!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
6
+ <pre> <!-- comment --> </pre>
7
+ <textarea> <!-- comment --> </textarea>
8
+ <script> <!-- comment --> </script>
9
+ <script type="text/x-jquery-tmpl"> <a> <!-- comment --> <b> </script>
10
+ <style> <!-- comment --> </style>
@@ -0,0 +1,11 @@
1
+ <style>
2
+ /* comment */
3
+ color: red;
4
+ </style>
5
+
6
+ <pre>
7
+ <style>
8
+ /* comment */
9
+ color: red;
10
+ </style>
11
+ </pre>
@@ -0,0 +1,6 @@
1
+ <style>color:red;</style><pre>
2
+ <style>
3
+ /* comment */
4
+ color: red;
5
+ </style>
6
+ </pre>
@@ -0,0 +1,24 @@
1
+ <script type="text/javascript">
2
+ var i = 0; //comment
3
+ i = i + 1;
4
+ alert(i);
5
+ </script>
6
+
7
+ <script>
8
+ <![CDATA[
9
+ var i = 0; //comment
10
+ i = i + 1;
11
+ alert(i);
12
+ ]]>
13
+ </script>
14
+
15
+ <pre>
16
+ <script>
17
+ var i = 0; //comment
18
+ i = i + 1;
19
+ alert(i);
20
+ </script>
21
+ </pre>
22
+
23
+ <script type="text/x-jquery-tmpl"> <a> <!-- comment --> <b> </script>
24
+ <script type="text/custom"> var i=1@#$%^2 <a> <!-- comment --> <b> </script>
@@ -0,0 +1,7 @@
1
+ <script type="text/javascript">var a=0;a+=1;alert(a);</script><script><![CDATA[var a=0;a+=1;alert(a);]]></script><pre>
2
+ <script>
3
+ var i = 0; //comment
4
+ i = i + 1;
5
+ alert(i);
6
+ </script>
7
+ </pre><script type="text/x-jquery-tmpl"><a><b></script><script type="text/custom"> var i=1@#$%^2 <a> <!-- comment --> <b> </script>
@@ -0,0 +1,7 @@
1
+ <script type="text/javascript">var i=0;i=i+1;alert(i);</script><script><![CDATA[var i=0;i=i+1;alert(i);]]></script><pre>
2
+ <script>
3
+ var i = 0; //comment
4
+ i = i + 1;
5
+ alert(i);
6
+ </script>
7
+ </pre><script type="text/x-jquery-tmpl"><a><b></script><script type="text/custom"> var i=1@#$%^2 <a> <!-- comment --> <b> </script>
@@ -0,0 +1 @@
1
+ <a x="aaa 'bbb' ccc" b="1"> <b onclick=" alert('<a> <b>') "/> <c/> <d/> <pre a=" 1 "> <x /> <y> </pre> <!--[if lt IE 7 ]><body class="ie6"><![endif]--> <!--[if lt IE 7 ]><body class="ie6"><![endif]--> <pre> <!-- comment --> </pre> <textarea> <!-- comment --> </textarea> <script> <!-- comment --> </script> <script type="text/x-jquery-tmpl"> <a> <b> </script> <style> <!-- comment --> </style>
@@ -0,0 +1 @@
1
+ html <!-- comment --> html
@@ -0,0 +1 @@
1
+ html <!-- comment --> html
@@ -0,0 +1,7 @@
1
+ <a> <b>
2
+ <!-- comment -->
3
+ <?php <!-- comment --> ?>
4
+ <% <!-- comment --> %>
5
+ <jsp: a b >
6
+ <!-- #include -->
7
+ <!--#include -->
@@ -0,0 +1 @@
1
+ <a><b><?php <!-- comment --> ?><% <!-- comment --> %><jsp: a b ><!-- #include --><!--#include -->
@@ -0,0 +1,17 @@
1
+ <!-- comment --><!-- --><!----><!--
2
+ -->
3
+
4
+ <pre> aaa <!-- comment --> bbb </pre>
5
+
6
+ <!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
7
+ <!--[if IE 7 ]> <body class="ie7"> <pre> aaaaaa sssssssss </pre> <![endif]-->
8
+ <!--[if IE 8 ]> <body class="ie8"> <![endif]-->
9
+ <!--[if IE 9 ]> <body class="ie9"> <![endif]-->
10
+ <!--[if (gt IE 9)|!(IE)]><!--> <body>
11
+
12
+ <script>
13
+ var i=0; //qweqwe
14
+ alert("qwe");
15
+ </script>
16
+
17
+ <!--<![endif]-->
@@ -0,0 +1,4 @@
1
+ <pre> aaa <!-- comment --> bbb </pre><!--[if lt IE 7 ]><body class="ie6"><![endif]--><!--[if IE 7 ]><body class="ie7"><pre> aaaaaa sssssssss </pre><![endif]--><!--[if IE 8 ]><body class="ie8"><![endif]--><!--[if IE 9 ]><body class="ie9"><![endif]--><!--[if (gt IE 9)|!(IE)]><!--><body><script>
2
+ var i=0; //qweqwe
3
+ alert("qwe");
4
+ </script><!--<![endif]-->
@@ -0,0 +1 @@
1
+ <form method = post> <form method = get> <form method="get"> <form method='get' name="name">
@@ -0,0 +1 @@
1
+ <form method=post> <form> <form> <form name="name">
@@ -0,0 +1 @@
1
+ <link href="http://leave" rel='alternate external'><link href="http://leave" rel=external><link href="http://leave" rel="external"><link href="http://example.com/style.css"/><script src = 'https://www.example.com/script.js'></script><a href= "//google.com"></a><img src = "/pic.jpg"><img alt="http://leave" src = "https://img"/>
@@ -0,0 +1 @@
1
+ <link href="http://leave" rel='alternate external'><link href="http://leave" rel=external><link href="http://leave" rel="external"><link href="//example.com/style.css"/><script src='https://www.example.com/script.js'></script><a href="//google.com"></a><img src="/pic.jpg"><img alt="http://leave" src="https://img"/>
@@ -0,0 +1 @@
1
+ <link href="https://leave" rel='alternate external'><link href="https://leave" rel=external><link href="https://leave" rel="external"><link href="http://example.com/style.css"/><script src = 'https://www.example.com/script.js'></script><a href= "//google.com"></a><img src ="/pic.jpg"><img alt="http://leave" src = "https://img"/>
@@ -0,0 +1 @@
1
+ <link href="https://leave" rel='alternate external'><link href="https://leave" rel=external><link href="https://leave" rel="external"><link href="http://example.com/style.css"/><script src='//www.example.com/script.js'></script><a href="//google.com"></a><img src="/pic.jpg"><img alt="http://leave" src="//img"/>
@@ -0,0 +1 @@
1
+ <input type="password"> <input type="text"/> <input type = text id="id"> <input type='text' id='id'/>
@@ -0,0 +1 @@
1
+ <input type="password"> <input/> <input id="id"> <input id='id'/>
@@ -0,0 +1,5 @@
1
+ <a b="1"> <b> <c/>
2
+ <d />
3
+ <pre a = " 1 "> <x /> <y> </pre>
4
+
5
+ <!--[if lt IE 7 ]> <body class="ie6"> <![endif]--> <!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
@@ -0,0 +1 @@
1
+ <a b="1"><b><c/><d/><pre a=" 1 "> <x /> <y> </pre><!--[if lt IE 7 ]><body class="ie6"><![endif]--><!--[if lt IE 7 ]><body class="ie6"><![endif]-->
@@ -0,0 +1 @@
1
+ <a onclick="javascript: alert()" onmousemove="move()" onmouseenter="javascript:alert();" href="javascript:alert()">
@@ -0,0 +1 @@
1
+ <a onclick="alert()" onmousemove="move()" onmouseenter="alert();" href="javascript:alert()">
@@ -0,0 +1,5 @@
1
+ <link type = "text/css"></link>
2
+ <link type = "text/plain" rel="stylesheet"></link>
3
+ <link type = text/css rel=stylesheet></link>
4
+ <link type = 'text/plain' rel='alternate stylesheet'></link>
5
+ <link rel=stylesheet></link>
@@ -0,0 +1 @@
1
+ <link type="text/css"></link> <link rel="stylesheet"></link> <link rel=stylesheet></link> <link rel='alternate stylesheet'></link> <link rel=stylesheet></link>
@@ -0,0 +1 @@
1
+ <a s="1 2" style="a : 1 ;"><a><b/><c/><d><pre a=" 1 "> <x /> <y> </pre>
@@ -0,0 +1 @@
1
+ <a s="1 2" style="a : 1 ;"><a><b/><c/><d><pre a=" 1 "> <x /> <y> </pre>
@@ -0,0 +1,7 @@
1
+ <a xxx="asd 123" ccc = 'eee' />
2
+ <a xxx="123" style="a:1;b:2" ccc = 'eee'/>
3
+ <a xxx="123" ccc = 'eee'
4
+ />
5
+ <a xxx="123" ccc = "eee" >
6
+ <a xxx="123" ccc = 'eaa"e"eaa'>
7
+ <a xxx="123" ccc = 'eee'>
@@ -0,0 +1 @@
1
+ <a xxx="asd 123" ccc=eee /> <a xxx=123 style="a:1;b:2" ccc=eee /> <a xxx=123 ccc=eee /> <a xxx=123 ccc=eee> <a xxx=123 ccc='eaa"e"eaa'> <a xxx=123 ccc=eee>
@@ -0,0 +1,6 @@
1
+ <script type = "text/javascript" language="javascript"></script>
2
+ <script type=text/javascript language ='javascript' src=""></script>
3
+ <script type='text/javascript' language = javascript></script>
4
+ <script
5
+ type = application/javascript
6
+ ></script>
@@ -0,0 +1 @@
1
+ <script></script> <script src=""></script> <script></script> <script></script>
@@ -0,0 +1 @@
1
+ <a href="a"/> qwe = eee <a href ="x" /> <a href= "x"/> <a href = "x" > <input value="test" /> <input value=test /> <input value=test > <br />
@@ -0,0 +1 @@
1
+ <a href="a"/> qwe = eee <a href="x"/> <a href="x"/> <a href="x"> <input value="test"/> <input value=test /> <input value=test> <br/>
@@ -0,0 +1,3 @@
1
+ <style type = "text/style"></style>
2
+ <style type=text/style ></style>
3
+ <style type='text/style' ></style>
@@ -0,0 +1 @@
1
+ <style></style> <style></style> <style></style>
@@ -0,0 +1 @@
1
+ <input checked> <input checked="checked"> checked="checked" <input selected = ''> <input disabled=disabled> <input readonly='true' id="id"/>
@@ -0,0 +1 @@
1
+ <input checked> <input checked> checked="checked" <input selected> <input disabled> <input readonly id="id"/>
@@ -0,0 +1,2 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -0,0 +1 @@
1
+ aaa <br> <p style=""> bbbb <br/> ccccccc </p> <b> ddddd </b> eeeeeeee
@@ -0,0 +1 @@
1
+ aaa<br><p style="">bbbb<br/>ccccccc</p><b> ddddd </b> eeeeeeee
@@ -0,0 +1,10 @@
1
+ <a x="aaa 'bbb' ccc" b="1"> <b onclick = " alert('<a> <b>') " /> <c/>
2
+ <d />
3
+ <pre a = " 1 "> <x /> <y> </pre>
4
+ <!-- comment -->
5
+ <!--[if lt IE 7 ]> <body class="ie6"> <![endif]--> <!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
6
+ <pre> <!-- comment --> </pre>
7
+ <textarea> <!-- comment --> </textarea>
8
+ <script> <!-- comment --> </script>
9
+ <script type="text/x-jquery-tmpl"> <a> <!-- comment --> <b> </script>
10
+ <style> <!-- comment --> </style>
@@ -0,0 +1,11 @@
1
+ <style>
2
+ /* comment */
3
+ color: red;
4
+ </style>
5
+
6
+ <pre>
7
+ <style>
8
+ /* comment */
9
+ color: red;
10
+ </style>
11
+ </pre>
@@ -0,0 +1,6 @@
1
+ <style>color:red;</style><pre>
2
+ <style>
3
+ /* comment */
4
+ color: red;
5
+ </style>
6
+ </pre>
@@ -0,0 +1,24 @@
1
+ <script type="text/javascript">
2
+ var i = 0; //comment
3
+ i = i + 1;
4
+ alert(i);
5
+ </script>
6
+
7
+ <script>
8
+ <![CDATA[
9
+ var i = 0; //comment
10
+ i = i + 1;
11
+ alert(i);
12
+ ]]>
13
+ </script>
14
+
15
+ <pre>
16
+ <script>
17
+ var i = 0; //comment
18
+ i = i + 1;
19
+ alert(i);
20
+ </script>
21
+ </pre>
22
+
23
+ <script type="text/x-jquery-tmpl"> <a> <!-- comment --> <b> </script>
24
+ <script type="text/custom"> var i=1@#$%^2 <a> <!-- comment --> <b> </script>
@@ -0,0 +1,7 @@
1
+ <script type="text/javascript">var a=0,a=a+1;alert(a);</script><script><![CDATA[var a=0,a=a+1;alert(a);]]></script><pre>
2
+ <script>
3
+ var i = 0; //comment
4
+ i = i + 1;
5
+ alert(i);
6
+ </script>
7
+ </pre><script type="text/x-jquery-tmpl"><a><b></script><script type="text/custom"> var i=1@#$%^2 <a> <!-- comment --> <b> </script>
@@ -0,0 +1,7 @@
1
+ <script type="text/javascript">var i=0;i=i+1;alert(i);</script><script><![CDATA[var i=0;i=i+1;alert(i);]]></script><pre>
2
+ <script>
3
+ var i = 0; //comment
4
+ i = i + 1;
5
+ alert(i);
6
+ </script>
7
+ </pre><script type="text/x-jquery-tmpl"><a><b></script><script type="text/custom"> var i=1@#$%^2 <a> <!-- comment --> <b> </script>
@@ -0,0 +1 @@
1
+ <a x="aaa 'bbb' ccc" b="1"> <b onclick=" alert('<a> <b>') "/> <c/> <d/> <pre a=" 1 "> <x /> <y> </pre> <!--[if lt IE 7 ]><body class="ie6"><![endif]--> <!--[if lt IE 7 ]><body class="ie6"><![endif]--> <pre> <!-- comment --> </pre> <textarea> <!-- comment --> </textarea> <script> <!-- comment --> </script> <script type="text/x-jquery-tmpl"> <a> <b> </script> <style> <!-- comment --> </style>
@@ -0,0 +1 @@
1
+ html <!-- comment --> html
@@ -0,0 +1 @@
1
+ html <!-- comment --> html
@@ -0,0 +1,11 @@
1
+ <a>
2
+
3
+
4
+ <b>
5
+
6
+
7
+ <c/>
8
+
9
+
10
+ </b>
11
+ </a>
@@ -0,0 +1,5 @@
1
+ <a>
2
+ <b>
3
+ <c/>
4
+ </b>
5
+ </a>
@@ -0,0 +1,7 @@
1
+ <a> <b>
2
+ <!-- comment -->
3
+ <?php <!-- comment --> ?>
4
+ <% <!-- comment --> %>
5
+ <jsp: a b >
6
+ <!-- #include -->
7
+ <!--#include -->
@@ -0,0 +1 @@
1
+ <a><b><?php <!-- comment --> ?><% <!-- comment --> %><jsp: a b ><!-- #include --><!--#include -->
@@ -0,0 +1,17 @@
1
+ <!-- comment --><!-- --><!----><!--
2
+ -->
3
+
4
+ <pre> aaa <!-- comment --> bbb </pre>
5
+
6
+ <!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
7
+ <!--[if IE 7 ]> <body class="ie7"> <pre> aaaaaa sssssssss </pre> <![endif]-->
8
+ <!--[if IE 8 ]> <body class="ie8"> <![endif]-->
9
+ <!--[if IE 9 ]> <body class="ie9"> <![endif]-->
10
+ <!--[if (gt IE 9)|!(IE)]><!--> <body>
11
+
12
+ <script>
13
+ var i=0; //qweqwe
14
+ alert("qwe");
15
+ </script>
16
+
17
+ <!--<![endif]-->
@@ -0,0 +1,4 @@
1
+ <pre> aaa <!-- comment --> bbb </pre><!--[if lt IE 7 ]><body class="ie6"><![endif]--><!--[if IE 7 ]><body class="ie7"><pre> aaaaaa sssssssss </pre><![endif]--><!--[if IE 8 ]><body class="ie8"><![endif]--><!--[if IE 9 ]><body class="ie9"><![endif]--><!--[if (gt IE 9)|!(IE)]><!--><body><script>
2
+ var i=0; //qweqwe
3
+ alert("qwe");
4
+ </script><!--<![endif]-->