Skip to content

Commit

Permalink
Merge pull request #37 from jekyll/html
Browse files Browse the repository at this point in the history
Render post content prior to feed generation
  • Loading branch information
benbalter committed May 20, 2015
2 parents 87a8e9c + a57834a commit 8f0911e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@

{% for post in site.posts %}
<entry>
<title>{{ post.title | xml_escape }}</title>
<title>{{ post.title | markdownify | strip_html | strip_newlines | xml_escape }}</title>
<link href="{{ post.url | prepend: url_base }}" rel="alternate" type="text/html" title="{{ post.title | xml_escape }}" />
<published>{{ post.date | date_to_xmlschema }}</published>
<updated>{{ post.date | date_to_xmlschema }}</updated>

<id>{{ post.id | prepend: url_base }}</id>
<content type="html">{{ post.content | xml_escape }}</content>
<content type="html">{{ post.content | markdownify | xml_escape }}</content>

{% if post.author %}
<author>
Expand All @@ -50,7 +50,7 @@
{% endfor %}

{% if post.excerpt %}
<summary>{{ post.excerpt | strip_html | strip_newlines | xml_escape }}</summary>
<summary>{{ post.excerpt | markdownify | strip_html | strip_newlines | xml_escape }}</summary>
{% endif %}
</entry>
{% endfor %}
Expand Down
2 changes: 2 additions & 0 deletions script/cibuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#! /bin/bash

set -e

bundle exec rspec
gem build jekyll-feed.gemspec
2 changes: 1 addition & 1 deletion spec/fixtures/_posts/2013-12-12-dec-the-second.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---

December the twelfth, actually.
# December the twelfth, actually.
4 changes: 4 additions & 0 deletions spec/jekyll-feed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
expect(contents).to match /Line 1\nLine 2\nLine 3/
end

it "converts markdown posts to HTML" do
expect(contents).to match /&lt;p&gt;March the second!&lt;\/p&gt;/
end

context "parsing" do
let(:feed) { RSS::Parser.parse(contents) }

Expand Down

0 comments on commit 8f0911e

Please sign in to comment.