Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
6a97759e
Commit
6a97759e
authored
Sep 12, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ImageLazyLoadFilter from EmailPipeline
parent
0cd1563f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
1 deletion
+27
-1
changelogs/unreleased/37629-lazy-image-loading-breaks-notification-mails-for-an-added-screenshot.yml
...ing-breaks-notification-mails-for-an-added-screenshot.yml
+5
-0
lib/banzai/filter/image_lazy_load_filter.rb
lib/banzai/filter/image_lazy_load_filter.rb
+2
-1
lib/banzai/pipeline/email_pipeline.rb
lib/banzai/pipeline/email_pipeline.rb
+6
-0
spec/lib/banzai/pipeline/email_pipeline_spec.rb
spec/lib/banzai/pipeline/email_pipeline_spec.rb
+14
-0
No files found.
changelogs/unreleased/37629-lazy-image-loading-breaks-notification-mails-for-an-added-screenshot.yml
0 → 100644
View file @
6a97759e
---
title
:
Image attachments are properly displayed in notification emails again
merge_request
:
14161
author
:
type
:
fixed
lib/banzai/filter/image_lazy_load_filter.rb
View file @
6a97759e
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
|
...
...
lib/banzai/pipeline/email_pipeline.rb
View file @
6a97759e
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
...
...
spec/lib/banzai/pipeline/email_pipeline_spec.rb
0 → 100644
View file @
6a97759e
require
'rails_helper'
describe
Banzai
::
Pipeline
::
EmailPipeline
do
describe
'.filters'
do
it
'returns the expected type'
do
expect
(
described_class
.
filters
).
to
be_kind_of
(
Banzai
::
FilterArray
)
end
it
'excludes ImageLazyLoadFilter'
do
expect
(
described_class
.
filters
).
not_to
be_empty
expect
(
described_class
.
filters
).
not_to
include
(
Banzai
::
Filter
::
ImageLazyLoadFilter
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment