1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Merge branch 'stable'

This commit is contained in:
Nathan Weizenbaum 2010-01-30 15:58:58 -08:00
commit 1f6eb357d3
3 changed files with 12 additions and 1 deletions

View file

@ -200,6 +200,8 @@ that surrounds the filtered text with `<style>` and CDATA tags.
make sure error reporting uses the correct line numbers,
and allow multi-line expressions.
* Fix a parsing bug for HTML-style attributes including `#`.
## [2.2.17](http://github.com/nex3/haml/commit/2.2.16)
* Fix compilation of HTML5 doctypes when using `html2haml`.

View file

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

View file

@ -612,6 +612,15 @@ HTML
HAML
end
def test_html_attributes_with_hash
assert_equal("<a href='#' rel='top'>Foo</a>\n",
render('%a(href="#" rel="top") Foo'))
assert_equal("<a href='#'>Foo</a>\n",
render('%a(href="#") #{"Foo"}'))
assert_equal("<a href='#\"'></a>\n", render('%a(href="#\\"")'))
end
# HTML escaping tests
def test_ampersand_equals_should_escape