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

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) def compile_cdata(node)
temple = [:multi] temple = [:multi]
temple << [:static, "<![CDATA[\n".freeze] temple << [:static, "<![CDATA[\n".freeze]
compile_text!(temple, node, ' '.freeze) compile_text!(temple, node, ' '.freeze)
temple << [:static, "\n]]>".freeze] temple << [:static, "\n]]>".freeze]
temple temple
end end

View file

@ -226,7 +226,7 @@ class CSSFilterTest < Haml::TestCase
end end
class CDATAFilterTest < Haml::TestCase 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" html = "<![CDATA[\n foo\n]]>\n"
haml = ":cdata\n foo" haml = ":cdata\n foo"
assert_equal(html, render(haml)) assert_equal(html, render(haml))

View file

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