Commit 676b2043 authored by Douwe Maan's avatar Douwe Maan

Merge branch '41208-commit-atom-feeds-double-escaped' into 'master'

Resolve "Commits atom feed is double-escaped"

Closes #41208

See merge request gitlab-org/gitlab-ce!16603
parents f816b3e9 4f34206a
xml.entry do xml.entry do
xml.id project_commit_url(@project, id: commit.id) xml.id project_commit_url(@project, id: commit.id)
xml.link href: project_commit_url(@project, id: commit.id) xml.link href: project_commit_url(@project, id: commit.id)
xml.title truncate(commit.title, length: 80) xml.title truncate(commit.title, length: 80, escape: false)
xml.updated commit.committed_date.xmlschema xml.updated commit.committed_date.xmlschema
xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(commit.author_email)) xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(commit.author_email))
...@@ -10,5 +10,5 @@ xml.entry do ...@@ -10,5 +10,5 @@ xml.entry do
xml.email commit.author_email xml.email commit.author_email
end end
xml.summary markdown(commit.description, pipeline: :single_line) xml.summary markdown(commit.description, pipeline: :single_line), type: 'html'
end end
---
title: Allows html text in commits atom feed
merge_request: 16603
author: Jacopo Beschi @jacopo-beschi
type: fixed
...@@ -41,15 +41,21 @@ describe Projects::CommitsController do ...@@ -41,15 +41,21 @@ describe Projects::CommitsController do
context "when the ref name ends in .atom" do context "when the ref name ends in .atom" do
context "when the ref does not exist with the suffix" do context "when the ref does not exist with the suffix" do
it "renders as atom" do before do
get(:show, get(:show,
namespace_id: project.namespace, namespace_id: project.namespace,
project_id: project, project_id: project,
id: "master.atom") id: "master.atom")
end
it "renders as atom" do
expect(response).to be_success expect(response).to be_success
expect(response.content_type).to eq('application/atom+xml') expect(response.content_type).to eq('application/atom+xml')
end end
it 'renders summary with type=html' do
expect(response.body).to include('<summary type="html">')
end
end end
context "when the ref exists with the suffix" do context "when the ref exists with the suffix" do
......
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