From df19a27753920deca94b80817d57eb0047dc77a5 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 10 Dec 2015 18:14:51 -0500 Subject: [PATCH] FIX: Don't sanitize `header_instructions` --- lib/email/message_builder.rb | 5 +++-- lib/pretty_text.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/email/message_builder.rb b/lib/email/message_builder.rb index 665c1455d..8d8b5e6ad 100644 --- a/lib/email/message_builder.rb +++ b/lib/email/message_builder.rb @@ -69,19 +69,20 @@ module Email header_instructions = @template_args[:header_instructions] if header_instructions.present? - header_instructions = PrettyText.cook(header_instructions).html_safe + header_instructions = PrettyText.cook(header_instructions, sanitize: false).html_safe html_override.gsub!("%{header_instructions}", header_instructions) else html_override.gsub!("%{header_instructions}", "") end if response_instructions = @template_args[:respond_instructions] - respond_instructions = PrettyText.cook(response_instructions).html_safe + respond_instructions = PrettyText.cook(response_instructions, sanitize: false).html_safe html_override.gsub!("%{respond_instructions}", respond_instructions) else html_override.gsub!("%{respond_instructions}", "") end + styled = Email::Styles.new(html_override, @opts) styled.format_basic diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb index 8d4dc5b8a..d50326d4e 100644 --- a/lib/pretty_text.rb +++ b/lib/pretty_text.rb @@ -187,7 +187,7 @@ module PrettyText decorate_context(context) context_opts = opts || {} - context_opts[:sanitize] ||= true + context_opts[:sanitize] = true unless context_opts[:sanitize] == false context['opts'] = context_opts context['raw'] = text