Skip to content

Commit 62ce886

Browse files
committed
Fetch line of description and tweak it at C/V in MVC
1 parent 52d47e8 commit 62ce886

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/models/podcast.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def title
4747
end
4848

4949
def description
50-
@desc ||= exists? ? self.content.lines.reject{|l| l =~ /^(\n|<)/ }.second.delete('<br>').strip : ''
50+
@desc ||= exists? ? self.content.lines.fourth : ''
5151
end
5252

5353
def published_at

app/views/podcasts/feed.rss.builder

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ xml.rss :version => "2.0", "xmlns:itunes" => "http://www.itunes.com/dtds/Podcast
2323
end
2424

2525
@episodes.each do |episode|
26-
description = Kramdown::Document.new(episode.description, input: 'GFM').to_html
26+
description = ActionView::Base.full_sanitizer.sanitize(Kramdown::Document.new(episode.description, input: 'GFM').to_html).strip
2727
xml.item do
2828
xml.title episode.title
2929
xml.author @author
3030
xml.itunes :image, @art_work_url
31-
xml.content :encoded, :text => CGI.escapeHTML(description)
32-
xml.description ActionView::Base.full_sanitizer.sanitize(description).strip
31+
xml.content :encoded, :text => description
32+
xml.description description
3333
xml.link "#{@base_url}#{episode.url}"
3434
xml.guid({:isPermaLink => "false"}, "#{@base_url}#{episode.url}")
3535
xml.itunes :explicit, "clean"

0 commit comments

Comments
 (0)