diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-02 06:21:13 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-02 06:21:13 +0000 |
commit | bf9b90a908235c9d0ce0c0466e3808619803bad8 (patch) | |
tree | fc043c9efa8c292cd1ac2f6de45d89df53e7b152 /actionpack/lib | |
parent | 2f61c431fa3beecb532c0c58c83e47f9759e64a5 (diff) | |
download | rails-bf9b90a908235c9d0ce0c0466e3808619803bad8.tar.gz rails-bf9b90a908235c9d0ce0c0466e3808619803bad8.tar.bz2 rails-bf9b90a908235c9d0ce0c0466e3808619803bad8.zip |
Adds the ability to include XML CDATA tags using Builder #1563 [Josh Knowles]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1598 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/vendor/builder/xmlmarkup.rb | 11 |
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 |