require 'helper' class TestSlimHtmlEscaping < TestSlim def test_html_will_not_be_escaped source = %q{ p World, meet "Slim". } assert_html '

World, meet "Slim".

', source end def test_html_with_newline_will_not_be_escaped source = %q{ p | World, meet "Slim". } assert_html "

World,\n meet \"Slim\".

", source end def test_html_with_escaped_interpolation source = %q{ - x = '"' - content = '' p class="#{x}" test #{content} } assert_html '

test <x>

', source end def test_html_nested_escaping source = %q{ = hello_world do | escaped & } assert_html 'Hello World from @env escaped & Hello World from @env', source end def test_html_quoted_attr_escape source = %q{ p id="&" class=="&" } assert_html '

', source end def test_html_quoted_attr_escape_with_interpolation source = %q{ p id="&#{'"'}" class=="&#{'"'}" p id="&#{{'"'}}" class=="&#{{'"'}}" } assert_html '

', source end def test_html_ruby_attr_escape source = %q{ p id=('&'.to_s) class==('&'.to_s) } assert_html '

', source end end