aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/inline_preview_interceptor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer/lib/action_mailer/inline_preview_interceptor.rb')
-rw-r--r--actionmailer/lib/action_mailer/inline_preview_interceptor.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/actionmailer/lib/action_mailer/inline_preview_interceptor.rb b/actionmailer/lib/action_mailer/inline_preview_interceptor.rb
index 9087d335fa..980415afe0 100644
--- a/actionmailer/lib/action_mailer/inline_preview_interceptor.rb
+++ b/actionmailer/lib/action_mailer/inline_preview_interceptor.rb
@@ -26,7 +26,7 @@ module ActionMailer
def transform! #:nodoc:
return message if html_part.blank?
- html_source.gsub!(PATTERN) do |match|
+ html_part.body = html_part.decoded.gsub(PATTERN) do |match|
if part = find_part(match[9..-2])
%[src="#{data_url(part)}"]
else
@@ -46,10 +46,6 @@ module ActionMailer
@html_part ||= message.html_part
end
- def html_source
- html_part.body.raw_source
- end
-
def data_url(part)
"data:#{part.mime_type};base64,#{strict_encode64(part.body.raw_source)}"
end