Add spaceless tag

This commit is contained in:
Justin Li
2015-06-26 10:00:34 -07:00
parent 8a8de46c6a
commit 74f9bad513
4 changed files with 39 additions and 0 deletions
+5
View File
@@ -417,4 +417,9 @@ class StandardFiltersTest < Minitest::Test
def test_cannot_access_private_methods
assert_template_result('a', "{{ 'a' | to_number }}")
end
def test_strip_html_whitespace
html = "<a>\n\n <b> \n <c>a</c> \r\n </b> </a>"
assert_template_result('<a><b><c>a</c></b></a>', "{{ a | strip_html_whitespace }}", { 'a' => html })
end
end # StandardFiltersTest
@@ -293,4 +293,9 @@ class StandardTagTest < Minitest::Test
def test_multiline_tag
assert_template_result '0 1 2 3', "0{%\nfor i in (1..3)\n%} {{\ni\n}}{%\nendfor\n%}"
end
def test_spaceless
html = "<a>\n\n <b> \n <c>a</c> \r\n </b> </a>"
assert_template_result '<a><b><c>a</c></b></a>', "{% spaceless %}#{html}{% endspaceless %}"
end
end # StandardTagTest