FIX: some blank topics and posts in summary email because they're images

This commit is contained in:
Neil Lalonde
2016-12-19 16:21:31 -05:00
parent 74956694e5
commit 3256620d5d
3 changed files with 7 additions and 5 deletions

View File

@@ -48,9 +48,9 @@ module UserNotificationsHelper
doc.css('div').first
end
def email_excerpt(html, posts_count=nil)
def email_excerpt(html_arg, posts_count=nil)
# only include 1st paragraph when more than 1 posts
html = first_paragraph_from(html).to_s if posts_count.nil? || posts_count > 1
html = (posts_count.nil? || posts_count > 1) ? (first_paragraph_from(html_arg)||html_arg).to_s : html_arg
PrettyText.format_for_email(html).html_safe
end