summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-09-13 09:24:12 +0000
committerDouwe Maan <douwe@gitlab.com>2017-09-13 09:24:12 +0000
commit9c9b1774cbdc2a6cdfbbf8cd33e87e62294e729a (patch)
tree7bb0ed161b707efdfecef7690d6eef78f062f8b4 /lib
parent3278681d26501963673ccec2fda417471e2a061c (diff)
parent6a97759ea86cd6d15eea1b17fd2526b4f0569108 (diff)
downloadgitlab-ce-9c9b1774cbdc2a6cdfbbf8cd33e87e62294e729a.tar.gz
Merge branch '37629-lazy-image-loading-breaks-notification-mails-for-an-added-screenshot' into 'master'
Resolve "Lazy image loading breaks notification mails for an added screenshot" Closes #37629 See merge request !14161
Diffstat (limited to 'lib')
-rw-r--r--lib/banzai/filter/image_lazy_load_filter.rb3
-rw-r--r--lib/banzai/pipeline/email_pipeline.rb6
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/banzai/filter/image_lazy_load_filter.rb b/lib/banzai/filter/image_lazy_load_filter.rb
index bcb4f332267..4cd9b02b76c 100644
--- a/lib/banzai/filter/image_lazy_load_filter.rb
+++ b/lib/banzai/filter/image_lazy_load_filter.rb
@@ -1,6 +1,7 @@
module Banzai
module Filter
- # HTML filter that moves the value of the src attribute to the data-src attribute so it can be lazy loaded
+ # HTML filter that moves the value of image `src` attributes to `data-src`
+ # so they can be lazy loaded.
class ImageLazyLoadFilter < HTML::Pipeline::Filter
def call
doc.xpath('descendant-or-self::img').each do |img|
diff --git a/lib/banzai/pipeline/email_pipeline.rb b/lib/banzai/pipeline/email_pipeline.rb
index e47c384afc1..8f5f144d582 100644
--- a/lib/banzai/pipeline/email_pipeline.rb
+++ b/lib/banzai/pipeline/email_pipeline.rb
@@ -1,6 +1,12 @@
module Banzai
module Pipeline
class EmailPipeline < FullPipeline
+ def self.filters
+ super.tap do |filter_array|
+ filter_array.delete(Banzai::Filter::ImageLazyLoadFilter)
+ end
+ end
+
def self.transform_context(context)
super(context).merge(
only_path: false