diff --git a/.themes/classic/source/atom.xml b/.themes/classic/source/atom.xml index ff8d259..83af3f8 100644 --- a/.themes/classic/source/atom.xml +++ b/.themes/classic/source/atom.xml @@ -4,26 +4,24 @@ layout: nil - {{ site.title | xml_escape }} + <![CDATA[{{ site.title }}]]> {{ site.time | date_to_xmlschema }} {{ site.url }}/ - {{ site.author | xml_escape }} - {% if site.email %} - {{ site.email | xml_escape }} - {% endif %} + + {% if site.email %}{% endif %} Octopress {% for post in site.posts limit: 20 %} - {{ post.title | xml_escape }} + <![CDATA[{{ post.title | cdata_escape }}]]> {{ post.date | date_to_xmlschema }} {{ site.url }}{{ post.id }} - {{ post.content | expand_urls: site.url | xml_escape }} + {% endfor %} diff --git a/plugins/octopress_filters.rb b/plugins/octopress_filters.rb index 7eaaaa7..ef8c1fb 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(//, ']]>') + end + # Replaces relative urls with full urls def expand_urls(input, url='') url ||= '/'