Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove support for parsed & conditional comments

  • Loading branch information...
commit defd5791092ee8a2b1d34309b4356c04f75610d2 1 parent 9f838b3
Forbes Lindesay authored
View
15 lib/compiler.js
@@ -507,17 +507,10 @@ Compiler.prototype = {
visitBlockComment: function(comment){
if (!comment.buffer) return;
if (this.pp) this.prettyIndent(1, true);
- if (0 == comment.val.trim().indexOf('if')) {
- this.buffer('<!--[' + comment.val.trim() + ']>');
- this.visit(comment.block);
- if (this.pp) this.prettyIndent(1, true);
- this.buffer('<![endif]-->');
- } else {
- this.buffer('<!--' + comment.val);
- this.visit(comment.block);
- if (this.pp) this.prettyIndent(1, true);
- this.buffer('-->');
- }
+ this.buffer('<!--' + comment.val);
+ this.visit(comment.block);
+ if (this.pp) this.prettyIndent(1, true);
+ this.buffer('-->');
},
/**
View
4 lib/parser.js
@@ -333,7 +333,9 @@ Parser.prototype = {
var node;
if ('indent' == this.peek().type) {
- node = new nodes.BlockComment(tok.val, this.block(), tok.buffer);
+ this.lexer.pipeless = true;
+ node = new nodes.BlockComment(tok.val, this.parseTextBlock(), tok.buffer);
+ this.lexer.pipeless = false;
} else {
node = new nodes.Comment(tok.val, tok.buffer);
}
View
4 test/cases/comments.conditional.html
@@ -1,4 +0,0 @@
-
-<!--[if IE lt 9]>
-<script src="/lame.js"></script>
-<![endif]-->
View
2  test/cases/comments.conditional.jade
@@ -1,2 +0,0 @@
-//if IE lt 9
- script(src='/lame.js')
View
30 test/cases/comments.html
@@ -7,23 +7,25 @@
<li>two</li>
</ul>
<!--
-<ul>
- <li>foo</li>
-</ul>
+ul
+ li foo
+
-->
<!-- block
-<!-- inline follow-->
-<li>three</li>
+// inline follow
+li three
+
-->
<!-- block
-<!-- inline followed by tags-->
-<ul>
- <li>four</li>
-</ul>
+// inline followed by tags
+ul
+ li four
+
+-->
+<!--if IE lt 9
+// inline
+script(src='/lame.js')
+// end-inline
+
-->
-<!--[if IE lt 9]>
-<!-- inline-->
-<script src="/lame.js"></script>
-<!-- end-inline-->
-<![endif]-->
<p>five</p>
Please sign in to comment.
Something went wrong with that request. Please try again.