Commit 47888482 authored by Phil Hughes's avatar Phil Hughes Committed by Jarka Kadlecova

Merge branch '36458-user-profile-activity-feed-contains-broken-image-links' into 'master'

Resolve "User profile activity feed contains broken image links"

Closes #36458

See merge request !13606
parent 4e813f1d
...@@ -176,7 +176,7 @@ module EventsHelper ...@@ -176,7 +176,7 @@ module EventsHelper
sanitize( sanitize(
text, text,
tags: %w(a img gl-emoji b pre code p span), 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 end
......
...@@ -62,6 +62,12 @@ describe EventsHelper do ...@@ -62,6 +62,12 @@ describe EventsHelper do
expect(helper.event_note(input)).to eq(expected) expect(helper.event_note(input)).to eq(expected)
end 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 context 'labels formatting' do
let(:input) { 'this should be ~label_1' } let(:input) { 'this should be ~label_1' }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment