Commit 1fee875e authored by Stan Hu's avatar Stan Hu Committed by Michael Kozono

Fix Markdown attachments in Releases not rendering with full URL

When uploading an attachment to the release text, the relative URLs of
attachments were not converted to full URLs because the e-mail pipeline
wasn't being called.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/293966
parent d7840984
......@@ -15,4 +15,4 @@
%p
%h4= _("Release notes:")
= markdown_field(@release, :description)
= markdown(@release.description, pipeline: :email, author: @release.author)
---
title: Fix Markdown attachments in Releases not rendering with full URL
merge_request: 50146
author:
type: fixed
......@@ -49,5 +49,14 @@ RSpec.describe Emails::Releases do
is_expected.to have_body_text('Release notes:')
is_expected.to have_body_text(release.description)
end
context 'release notes with attachment' do
let(:upload_path) { '/uploads/e90decf88d8f96fe9e1389afc2e4a91f/test.jpg' }
let(:release) { create(:release, project: project, description: "Attachment: [Test file](#{upload_path})") }
it 'renders absolute links' do
is_expected.to have_body_text(%Q(<a href="#{project.web_url}#{upload_path}" data-link="true" class="gfm">Test file</a>))
end
end
end
end
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