summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-01-22 15:13:22 +0000
committerDouwe Maan <douwe@gitlab.com>2018-01-22 15:13:22 +0000
commit676b2043f7fb5fc80a7faf13eda42ea490fa9fc9 (patch)
tree6520909fd0e6bc112f978be5c4959f1c012e26a5
parentf816b3e9f2a77c2afd93999ba0ca202fc8e191d0 (diff)
parent4f34206a5b9308efeb0970bfe62434e8fedf15c5 (diff)
downloadgitlab-ce-676b2043f7fb5fc80a7faf13eda42ea490fa9fc9.tar.gz
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
-rw-r--r--app/views/projects/commits/_commit.atom.builder4
-rw-r--r--changelogs/unreleased/41208-commit-atom-feeds-double-escaped.yml5
-rw-r--r--spec/controllers/projects/commits_controller_spec.rb8
3 files changed, 14 insertions, 3 deletions
diff --git a/app/views/projects/commits/_commit.atom.builder b/app/views/projects/commits/_commit.atom.builder
index d806acdda13..04914888763 100644
--- a/app/views/projects/commits/_commit.atom.builder
+++ b/app/views/projects/commits/_commit.atom.builder
@@ -1,7 +1,7 @@
xml.entry do
xml.id 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.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(commit.author_email))
@@ -10,5 +10,5 @@ xml.entry do
xml.email commit.author_email
end
- xml.summary markdown(commit.description, pipeline: :single_line)
+ xml.summary markdown(commit.description, pipeline: :single_line), type: 'html'
end
diff --git a/changelogs/unreleased/41208-commit-atom-feeds-double-escaped.yml b/changelogs/unreleased/41208-commit-atom-feeds-double-escaped.yml
new file mode 100644
index 00000000000..76d3c6eda24
--- /dev/null
+++ b/changelogs/unreleased/41208-commit-atom-feeds-double-escaped.yml
@@ -0,0 +1,5 @@
+---
+title: Allows html text in commits atom feed
+merge_request: 16603
+author: Jacopo Beschi @jacopo-beschi
+type: fixed
diff --git a/spec/controllers/projects/commits_controller_spec.rb b/spec/controllers/projects/commits_controller_spec.rb
index 73fb90d73ec..55ed276f96b 100644
--- a/spec/controllers/projects/commits_controller_spec.rb
+++ b/spec/controllers/projects/commits_controller_spec.rb
@@ -41,15 +41,21 @@ describe Projects::CommitsController do
context "when the ref name ends in .atom" do
context "when the ref does not exist with the suffix" do
- it "renders as atom" do
+ before do
get(:show,
namespace_id: project.namespace,
project_id: project,
id: "master.atom")
+ end
+ it "renders as atom" do
expect(response).to be_success
expect(response.content_type).to eq('application/atom+xml')
end
+
+ it 'renders summary with type=html' do
+ expect(response.body).to include('<summary type="html">')
+ end
end
context "when the ref exists with the suffix" do