From 2c4acbc67f934f52896f08796d7f0e1262b8d4d2 Mon Sep 17 00:00:00 2001 From: Adam Prescott Date: Thu, 21 Mar 2013 18:47:09 +0000 Subject: [PATCH] Escape post.title in atom.xml. If post.title were to contain one of '&', '<', or '>', the XML would become invalid. xml_escape is a Jekyll extension of Liquid to safely escape values. Using straight Liquid, this could also be done with: {{ post.title | escape | replace:'&','&' | replace:'<','<' | replace:'>','>' }} (Note, type=html and then the additional XML escaping.) --- atom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom.xml b/atom.xml index f529849..aac0930 100644 --- a/atom.xml +++ b/atom.xml @@ -16,7 +16,7 @@ layout: nil {% for post in site.posts %} - {{ post.title }} + {{ post.title | xml_escape }} {{ post.date | date_to_xmlschema }} http://blog.rubygems.org{{ post.id }}