Skip to content
Snippets Groups Projects
Commit 2bfee070 authored by Tim Zallmann's avatar Tim Zallmann Committed by Phil Hughes
Browse files

Resolve "User profile activity feed contains broken image links"

parent 6509833c
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -176,7 +176,7 @@ module EventsHelper
sanitize(
text,
tags: %w(a img gl-emoji b pre code p span),
attributes: Rails::Html::WhiteListSanitizer.allowed_attributes + ['style', 'data-name', 'data-unicode-version']
attributes: Rails::Html::WhiteListSanitizer.allowed_attributes + ['style', 'data-src', 'data-name', 'data-unicode-version']
)
end
 
Loading
Loading
Loading
Loading
@@ -62,6 +62,12 @@ describe EventsHelper do
expect(helper.event_note(input)).to eq(expected)
end
 
it 'preserves data-src for lazy images' do
input = "![ImageTest](/uploads/test.png)"
image_url = "data-src=\"/uploads/test.png\""
expect(helper.event_note(input)).to match(image_url)
end
context 'labels formatting' do
let(:input) { 'this should be ~label_1' }
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment