2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

FIX: lazyYT youtube links not getting included in email

This commit is contained in:
Arpit Jalan 2014-08-21 16:24:05 +05:30
parent e3640060fc
commit f92b69ed2f
2 changed files with 30 additions and 0 deletions

View file

@ -4,12 +4,17 @@
#
module Email
class Styles
@@plugin_callbacks = []
def initialize(html)
@html = html
@fragment = Nokogiri::HTML.fragment(@html)
end
def self.register_plugin_style(&block)
@@plugin_callbacks.push(block)
end
def add_styles(node, new_styles)
existing = node['style']
if existing.present?
@ -60,6 +65,7 @@ module Email
correct_footer_style
reset_tables
onebox_styles
plugin_styles
end
def onebox_styles
@ -113,6 +119,12 @@ module Email
style('.featured-topic a', 'text-decoration: none; font-weight: bold; color: #006699; margin-right: 5px')
onebox_styles
plugin_styles
end
# this method is reserved for styles specific to plugin
def plugin_styles
@@plugin_callbacks.each { |block| block.call(@fragment) }
end
def to_html