diff --git a/lib/email/html_cleaner.rb b/lib/email/html_cleaner.rb index 96f6d313e..e8c89f7a1 100644 --- a/lib/email/html_cleaner.rb +++ b/lib/email/html_cleaner.rb @@ -7,9 +7,10 @@ module Email # Elements to hoist all children out of HTML_HOIST_ELEMENTS = %w(div span font table tbody th tr td) # Node types to always delete - HTML_DELETE_ELEMENT_TYPES = [Nokogiri::XML::Node::DTD_NODE, - Nokogiri::XML::Node::COMMENT_NODE, - ] + HTML_DELETE_ELEMENT_TYPES = [ + Nokogiri::XML::Node::DTD_NODE, + Nokogiri::XML::Node::COMMENT_NODE, + ] # Private variables: # @doc - nokogiri document diff --git a/plugins/poll/plugin.rb b/plugins/poll/plugin.rb index d6b6181e2..e0b403fe8 100644 --- a/plugins/poll/plugin.rb +++ b/plugins/poll/plugin.rb @@ -14,6 +14,11 @@ VOTES_CUSTOM_FIELD ||= "polls-votes".freeze after_initialize do + # remove "Vote Now!" & "Show Results" links in emails + Email::Styles.register_plugin_style do |fragment| + fragment.css(".poll a.cast-votes, .poll a.toggle-results").each(&:remove) + end + module ::DiscoursePoll class Engine < ::Rails::Engine engine_name PLUGIN_NAME