diff --git a/app/views/admin/e_paper_criterias/emailer.html.erb b/app/views/admin/e_paper_criterias/emailer.html.erb index 6ac6295..0c52fdd 100644 --- a/app/views/admin/e_paper_criterias/emailer.html.erb +++ b/app/views/admin/e_paper_criterias/emailer.html.erb @@ -160,10 +160,14 @@ width: 80%; margin: 10px; } + .epaper-show img { + max-width: 100%; + } <% def fix_local_url(siteurl, contents) + return nil if contents.blank? doc = Nokogiri::HTML.fragment(contents, encoding = 'UTF-8') doc.css('img[src], script[src]').each do |src_tag| src = src_tag.attribute('src').value @@ -179,7 +183,7 @@ link_tag.attribute('href').value = siteurl + href end end - doc.to_html + doc.to_html.html_safe end have_papaers = papers_data.present? @@ -188,16 +192,8 @@ else img_src = nil end - if paper.description.present? - paper_description = fix_local_url(siteurl, paper.description).html_safe - else - paper_description = nil - end - if paper.content.present? - paper_content = fix_local_url(siteurl, paper.content).html_safe - else - paper_content = nil - end + paper_description = fix_local_url(siteurl, paper.description) + paper_content = fix_local_url(siteurl, paper.content) %>