Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4f34206a
Commit
4f34206a
authored
Jan 21, 2018
by
Jacopo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allows html in commits atom feed
Html code now works in commits atom feed `title` and `summary`.
parent
269594bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
app/views/projects/commits/_commit.atom.builder
app/views/projects/commits/_commit.atom.builder
+2
-2
changelogs/unreleased/41208-commit-atom-feeds-double-escaped.yml
...ogs/unreleased/41208-commit-atom-feeds-double-escaped.yml
+5
-0
spec/controllers/projects/commits_controller_spec.rb
spec/controllers/projects/commits_controller_spec.rb
+7
-1
No files found.
app/views/projects/commits/_commit.atom.builder
View file @
4f34206a
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
changelogs/unreleased/41208-commit-atom-feeds-double-escaped.yml
0 → 100644
View file @
4f34206a
---
title
:
Allows html text in commits atom feed
merge_request
:
16603
author
:
Jacopo Beschi @jacopo-beschi
type
:
fixed
spec/controllers/projects/commits_controller_spec.rb
View file @
4f34206a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment