BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
f636854c
Commit
f636854c
authored
Mar 07, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '26790-label-color-todos' into 'master'
#26790 whitelist style attribute in event_note Closes #26790 See merge request !9155
parents
b0668616
9bcd0540
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
events_helper.rb
app/helpers/events_helper.rb
+6
-1
26790-label-color-todos.yml
changelogs/unreleased/26790-label-color-todos.yml
+4
-0
events_helper_spec.rb
spec/helpers/events_helper_spec.rb
+7
-0
No files found.
app/helpers/events_helper.rb
View file @
f636854c
...
...
@@ -162,7 +162,12 @@ module EventsHelper
def
event_note
(
text
,
options
=
{})
text
=
first_line_in_markdown
(
text
,
150
,
options
)
sanitize
(
text
,
tags:
%w(a img b pre code p span)
)
sanitize
(
text
,
tags:
%w(a img b pre code p span)
,
attributes:
Rails
::
Html
::
WhiteListSanitizer
.
allowed_attributes
+
[
'style'
]
)
end
def
event_commit_title
(
message
)
...
...
changelogs/unreleased/26790-label-color-todos.yml
0 → 100644
View file @
f636854c
---
title
:
fix background color for labels mention in todo
merge_request
:
9155
author
:
mhasbini
spec/helpers/events_helper_spec.rb
View file @
f636854c
...
...
@@ -61,6 +61,13 @@ describe EventsHelper do
'</code></pre>'
expect
(
helper
.
event_note
(
input
)).
to
eq
(
expected
)
end
it
'preserves style attribute within a tag'
do
input
=
'<span class="" style="background-color: #44ad8e; color: #FFFFFF;"></span>'
expected
=
'<p><span style="background-color: #44ad8e; color: #FFFFFF;"></span></p>'
expect
(
helper
.
event_note
(
input
)).
to
eq
(
expected
)
end
end
describe
'#event_commit_title'
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