Resolve "User profile activity feed contains broken image links"
This commit is contained in:
parent
6509833cfa
commit
2bfee0706a
|
@ -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
|
||||
|
||||
|
|
|
@ -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…
Reference in New Issue