Indent cdata filter with 4 spaces

It's original behavior.
https://github.com/haml/haml/blob/4.0.7/lib/haml/filters.rb#L259

Related to:
https://github.com/k0kubun/hamlit/pull/84
This commit is contained in:
Takashi Kokubun 2016-08-27 00:58:04 +09:00
parent 9ec042496f
commit 8edad66edc
3 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ module Hamlit
def compile_cdata(node)
temple = [:multi]
temple << [:static, "<![CDATA[\n".freeze]
compile_text!(temple, node, ' '.freeze)
compile_text!(temple, node, ' '.freeze)
temple << [:static, "\n]]>".freeze]
temple
end

View File

@ -226,7 +226,7 @@ class CSSFilterTest < Haml::TestCase
end
class CDATAFilterTest < Haml::TestCase
test "should wrap output in CDATA tag" do; skip
test "should wrap output in CDATA tag" do
html = "<![CDATA[\n foo\n]]>\n"
haml = ":cdata\n foo"
assert_equal(html, render(haml))

View File

@ -5,7 +5,7 @@ describe Hamlit::Filters do
it 'renders cdata' do
assert_render(<<-HTML.unindent, <<-HAML.unindent)
<![CDATA[
foo bar
foo bar
]]>
HTML
:cdata
@ -16,7 +16,7 @@ describe Hamlit::Filters do
it 'parses string interpolation' do
assert_render(<<-HTML.unindent, <<-HAML.unindent)
<![CDATA[
foo <&> bar
foo <&> bar
]]>
HTML
:cdata