aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/vendor/builder/xmlmarkup.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/vendor/builder/xmlmarkup.rb b/actionpack/lib/action_view/vendor/builder/xmlmarkup.rb
index 4f82704c20..b7e3b2d009 100644
--- a/actionpack/lib/action_view/vendor/builder/xmlmarkup.rb
+++ b/actionpack/lib/action_view/vendor/builder/xmlmarkup.rb
@@ -239,6 +239,17 @@ module Builder
[:version, :encoding, :standalone])
end
+ # Surrounds the given text with a CDATA tag
+ #
+ # For example:
+ #
+ # xml.cdata! "blah blah blah"
+ # # => <![CDATA[blah blah blah]]>
+ def cdata!(text)
+ _ensure_no_block block_given?
+ _special("<![CDATA[", "]]>", text, nil)
+ end
+
private
# NOTE: All private methods of a builder object are prefixed when