Returns a CDATA section with the given content. CDATA sections are used to escape blocks of text containing characters which would otherwise be recognized as markup. CDATA sections begin with the string <![CDATA[ and end with (and may not contain) the string ]]>.
Examples
cdata_section("<hello world>") # => <![CDATA[<hello world>]]> cdata_section(File.read("hello_world.txt")) # => <![CDATA[<hello from a text file]]></hello>
Source Code
# File action_view/helpers/tag_helper.rb, line 89 def cdata_section(content) "<![CDATA[#{content}]]>" end
<code/>and<pre/>for code samples.