diff --git a/lib/jekyll-feed/feed.xml b/lib/jekyll-feed/feed.xml index 4d4fd16d..a7417ec2 100644 --- a/lib/jekyll-feed/feed.xml +++ b/lib/jekyll-feed/feed.xml @@ -45,8 +45,10 @@ {% endif %} {% for post in posts limit: 10 %} - {{ post.title | smartify | strip_html | normalize_whitespace | xml_escape }} - + {% assign post_title = post.title | smartify | strip_html | normalize_whitespace | xml_escape %} + + {{ post_title }} + {{ post.date | date_to_xmlschema }} {{ post.last_modified_at | default: post.date | date_to_xmlschema }} {{ post.id | absolute_url | xml_escape }} diff --git a/spec/fixtures/_posts/2014-03-04-march-the-fourth.md b/spec/fixtures/_posts/2014-03-04-march-the-fourth.md index 817ee53b..3e3ff140 100644 --- a/spec/fixtures/_posts/2014-03-04-march-the-fourth.md +++ b/spec/fixtures/_posts/2014-03-04-march-the-fourth.md @@ -1,4 +1,5 @@ --- +title: Sparkling Title tags: - '"/>' image: diff --git a/spec/jekyll-feed_spec.rb b/spec/jekyll-feed_spec.rb index 9dce5cea..aa5596fb 100644 --- a/spec/jekyll-feed_spec.rb +++ b/spec/jekyll-feed_spec.rb @@ -87,6 +87,10 @@ expect(contents).to match 'The plugin will properly strip newlines.' end + it "strips HTML from link titles" do + expect(contents).to match %r!! + end + it "renders Liquid inside posts" do expect(contents).to match "Liquid is rendered." expect(contents).not_to match "Liquid is not rendered."