Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Jun 7, 2010
2 parents 4383b44 + 7dd7108 commit 1d9bfd5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions doc-src/HAML_CHANGELOG.md
Expand Up @@ -11,6 +11,10 @@ The way we determine the location of the Haml installation
no longer breaks the version of JRuby
used by [`appengine-jruby`](http://code.google.com/p/appengine-jruby/).

### Bug Fixes

* Single-line comments are now handled properly by `html2haml`.

## 3.0.9

[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.9).
Expand Down
2 changes: 1 addition & 1 deletion lib/haml/html.rb
Expand Up @@ -221,7 +221,7 @@ def to_haml(tabs, options)
if content.include?("\n")
"#{tabulate(tabs)}/#{condition}\n#{parse_text(content, tabs + 1)}"
else
"#{tabulate(tabs)}/#{condition} #{content.strip}"
"#{tabulate(tabs)}/#{condition} #{content.strip}\n"
end
end
end
Expand Down
7 changes: 7 additions & 0 deletions test/haml/html2haml_test.rb
Expand Up @@ -86,6 +86,13 @@ def test_inline_text

def test_inline_comment
assert_equal("/ foo", render("<!-- foo -->"))
assert_equal(<<HAML.strip, render(<<HTML))
/ foo
%p bar
HAML
<!-- foo -->
<p>bar</p>
HTML
end

def test_non_inline_comment
Expand Down

0 comments on commit 1d9bfd5

Please sign in to comment.