From 6315527b2f7676ae4afa1ce5cb78e11d25917f23 Mon Sep 17 00:00:00 2001
From: Frederic Hemberger <mail@frederic-hemberger.de>
Date: Tue, 4 Oct 2011 19:18:40 +0200
Subject: Adds CDATA sections to atom.xml, fixes #198

---
 plugins/octopress_filters.rb | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'plugins')

diff --git a/plugins/octopress_filters.rb b/plugins/octopress_filters.rb
index 7eaaaa7c..ef8c1fb2 100644
--- a/plugins/octopress_filters.rb
+++ b/plugins/octopress_filters.rb
@@ -63,6 +63,11 @@ module OctopressLiquidFilters
     return (content.nil?) ? input : content
   end
 
+  # Escapes CDATA sections in post content
+  def cdata_escape(input)
+    input.gsub(/<!\[CDATA\[/, '&lt;![CDATA[').gsub(/\]\]>/, ']]&gt;')
+  end
+
   # Replaces relative urls with full urls
   def expand_urls(input, url='')
     url ||= '/'
-- 
cgit v1.2.1