mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 02:52:44 +08:00
FIX: better support for featured link topics in summary emails
This commit is contained in:
parent
3256620d5d
commit
a65281d5ea
|
@ -36,9 +36,9 @@ module UserNotificationsHelper
|
||||||
doc = Nokogiri::HTML(html)
|
doc = Nokogiri::HTML(html)
|
||||||
|
|
||||||
result = ""
|
result = ""
|
||||||
doc.css('p').each do |p|
|
doc.css('body > p, aside.onebox').each do |node|
|
||||||
if p.text.present?
|
if node.text.present?
|
||||||
result << p.to_s
|
result << node.to_s
|
||||||
return result if result.size >= 100
|
return result if result.size >= 100
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -152,7 +152,6 @@ module Email
|
||||||
end
|
end
|
||||||
|
|
||||||
def format_html
|
def format_html
|
||||||
# lowest priority first
|
|
||||||
style('.with-accent-colors', "background-color: #{SiteSetting.email_accent_bg_color}; color: #{SiteSetting.email_accent_fg_color};")
|
style('.with-accent-colors', "background-color: #{SiteSetting.email_accent_bg_color}; color: #{SiteSetting.email_accent_fg_color};")
|
||||||
style('h4', 'color: #222;')
|
style('h4', 'color: #222;')
|
||||||
style('h3', 'margin: 15px 0 20px 0;')
|
style('h3', 'margin: 15px 0 20px 0;')
|
||||||
|
@ -162,7 +161,6 @@ module Email
|
||||||
style('li', 'padding-bottom: 10px')
|
style('li', 'padding-bottom: 10px')
|
||||||
style('div.footer', 'color:#666; font-size:95%; text-align:center; padding-top:15px;')
|
style('div.footer', 'color:#666; font-size:95%; text-align:center; padding-top:15px;')
|
||||||
style('span.post-count', 'margin: 0 5px; color: #777;')
|
style('span.post-count', 'margin: 0 5px; color: #777;')
|
||||||
style('.post-excerpt img', "max-width: 50%; max-height: 400px;")
|
|
||||||
style('pre', 'word-wrap: break-word; max-width: 694px;')
|
style('pre', 'word-wrap: break-word; max-width: 694px;')
|
||||||
style('code', 'background-color: #f1f1ff; padding: 2px 5px;')
|
style('code', 'background-color: #f1f1ff; padding: 2px 5px;')
|
||||||
style('pre code', 'display: block; background-color: #f1f1ff; padding: 5px;')
|
style('pre code', 'display: block; background-color: #f1f1ff; padding: 5px;')
|
||||||
|
@ -170,6 +168,8 @@ module Email
|
||||||
|
|
||||||
onebox_styles
|
onebox_styles
|
||||||
plugin_styles
|
plugin_styles
|
||||||
|
|
||||||
|
style('.post-excerpt img', "max-width: 50%; max-height: 400px;")
|
||||||
end
|
end
|
||||||
|
|
||||||
# this method is reserved for styles specific to plugin
|
# this method is reserved for styles specific to plugin
|
||||||
|
|
Loading…
Reference in New Issue
Block a user