Skip to content

Commit

Permalink
Switched xml_escape for <![CDATA[]]> for post content (#332)
Browse files Browse the repository at this point in the history
Merge pull request 332
  • Loading branch information
michaelnordmeyer committed Jan 1, 2022
1 parent 385f455 commit 1ac64bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/jekyll-feed/feed.xml
Expand Up @@ -63,7 +63,7 @@
<id>{{ post.id | absolute_url | xml_escape }}</id>
{% assign excerpt_only = post.feed.excerpt_only | default: site.feed.excerpt_only %}
{% unless excerpt_only %}
<content type="html" xml:base="{{ post.url | absolute_url | xml_escape }}">{{ post.content | strip | xml_escape }}</content>
<content type="html" xml:base="{{ post.url | absolute_url | xml_escape }}"><![CDATA[{{ post.content | strip }}]]></content>
{% endunless %}

{% assign post_author = post.author | default: post.authors[0] | default: site.author %}
Expand Down Expand Up @@ -96,7 +96,7 @@

{% assign post_summary = post.description | default: post.excerpt %}
{% if post_summary and post_summary != empty %}
<summary type="html">{{ post_summary | strip_html | normalize_whitespace | xml_escape }}</summary>
<summary type="html"><![CDATA[{{ post_summary | strip_html | normalize_whitespace }}]]></summary>
{% endif %}

{% assign post_image = post.image.path | default: post.image %}
Expand Down
2 changes: 1 addition & 1 deletion spec/jekyll-feed_spec.rb
Expand Up @@ -76,7 +76,7 @@
end

it "converts markdown posts to HTML" do
expect(contents).to match %r!&lt;p&gt;March the second\!&lt;/p&gt;!
expect(contents).to match %r!<\!\[CDATA\[<p>March the second\!</p>\]\]!
end

it "uses last_modified_at where available" do
Expand Down

0 comments on commit 1ac64bc

Please sign in to comment.