Skip to content

Commit

Permalink
Add more tags to the explicit self close list since we never self clo…
Browse files Browse the repository at this point in the history
…se by content anymore. Also added a test case for the bug we just fixed.
  • Loading branch information
creationix committed Jan 16, 2010
1 parent c3de2b9 commit b1fa422
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/haml.js
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions test/no_self_close_div.haml
@@ -0,0 +1,7 @@
%html
%body
%div#a
%div I do not self close.
:javascript
(function(){document.getElementById('a').textContent='I self
close';})();
9 changes: 9 additions & 0 deletions test/no_self_close_div.html
@@ -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.