Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched xml_escape for <![CDATA[]]> for post content #332

Merged
merged 3 commits into from Jan 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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