Permalink
Browse files

Add more tags to the explicit self close list since we never self clo…

…se by content anymore. Also added a test case for the bug we just fixed.
  • Loading branch information...
1 parent c3de2b9 commit b1fa42226b371c3be89023b50ef5ac5ebbab995a @creationix committed Jan 16, 2010
Showing with 17 additions and 1 deletion.
  1. +1 −1 lib/haml.js
  2. +7 −0 test/no_self_close_div.haml
  3. +9 −0 test/no_self_close_div.html
View
@@ -126,7 +126,7 @@ if (exports) {
return attributes;
}
- self_close_tags = ["meta", "img", "link", "br", "hr"];
+ self_close_tags = ["meta", "img", "link", "br", "hr", "input", "area", "base"];
// All matchers' regexps should capture leading whitespace in first capture
// and trailing content in last capture
@@ -0,0 +1,7 @@
+%html
+ %body
+ %div#a
+ %div I do not self close.
+ :javascript
+ (function(){document.getElementById('a').textContent='I self
+ close';})();
@@ -0,0 +1,9 @@
+<html><body><div id="a"></div><div>I do not self close.
+</div>
+<script type="text/javascript">
+//<![CDATA[
+ (function(){document.getElementById('a').textContent='I self
+ close';})();
+//]]>
+</script>
+</body></html>

0 comments on commit b1fa422

Please sign in to comment.