Spec for inline JS and CDATA tags.

This commit is contained in:
Yorick Peterse 2014-09-03 00:34:10 +02:00
parent f268af5bc6
commit 145315c26a
1 changed files with 10 additions and 0 deletions

View File

@ -24,5 +24,15 @@ describe Oga::XML::Lexer do
[:T_ELEM_END, nil, 1]
]
end
example 'lex inline Javascript containing a CDATA tag' do
lex("<script>#{@javascript}<![CDATA[foo]]></script>").should == [
[:T_ELEM_START, nil, 1],
[:T_ELEM_NAME, 'script', 1],
[:T_TEXT, @javascript, 1],
[:T_CDATA, 'foo', 1],
[:T_ELEM_END, nil, 1]
]
end
end
end