mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Haml] [Html] Fix a bug with single-line comments.
This commit is contained in:
parent
547b2a0583
commit
7dd7108639
3 changed files with 12 additions and 1 deletions
|
@ -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).
|
||||
|
|
|
@ -221,7 +221,7 @@ module Haml
|
|||
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
|
||||
|
|
|
@ -86,6 +86,13 @@ HTML
|
|||
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue