[Haml] Fix a bug with new attribute parsing.

Closes gh-18
This commit is contained in:
Nathan Weizenbaum 2009-07-12 10:36:47 -04:00
parent 8d3f1403f3
commit 84670b259a
2 changed files with 5 additions and 1 deletions

View File

@ -617,7 +617,7 @@ END
return name, [:dynamic, var]
end
re = /((?:\\.|\#[^{]|[^#{quote}\\#])*)(#{quote}|#\{)/
re = /((?:\\.|\#[^{]|[^#{quote}\\#])*#?)(#{quote}|#\{)/
content = []
loop do
return false unless scanner.scan(re)

View File

@ -421,6 +421,10 @@ HAML
HAML
end
def test_new_attrs_with_hash
assert_equal("<a href='#'></a>\n", render('%a(href="#")'))
end
# HTML escaping tests
def test_ampersand_equals_should_escape