From 16df67b1486d0651494a27d77f8e0469f4f1563f Mon Sep 17 00:00:00 2001 From: Sergey Nartimov Date: Mon, 30 Apr 2012 16:08:06 +0300 Subject: split CDATA end token in cdata_section helper --- actionpack/lib/action_view/helpers/tag_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers/tag_helper.rb') diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb index 23777721f6..f7afa48256 100644 --- a/actionpack/lib/action_view/helpers/tag_helper.rb +++ b/actionpack/lib/action_view/helpers/tag_helper.rb @@ -109,8 +109,12 @@ module ActionView # # cdata_section(File.read("hello_world.txt")) # # => + # + # cdata_section("hello]]>world") + # # => world]]> def cdata_section(content) - "".html_safe + splitted = content.gsub(']]>', ']]]]>') + "".html_safe end # Returns an escaped version of +html+ without affecting existing escaped entities. -- cgit v1.2.3