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
80a4c808
Commit
80a4c808
authored
Jan 12, 2016
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make diff_line_content helper return a safe String. #3945
parent
ee2230c3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
diff_helper.rb
app/helpers/diff_helper.rb
+2
-2
preview.html.haml
app/views/projects/blob/preview.html.haml
+1
-1
_text_file.html.haml
app/views/projects/diffs/_text_file.html.haml
+1
-1
_diff.html.haml
app/views/projects/notes/discussions/_diff.html.haml
+1
-1
No files found.
app/helpers/diff_helper.rb
View file @
80a4c808
...
...
@@ -111,9 +111,9 @@ module DiffHelper
def
diff_line_content
(
line
)
if
line
.
blank?
" "
" "
.
html_safe
else
line
line
.
try
(
:html_safe
)
end
end
...
...
app/views/projects/blob/preview.html.haml
View file @
80a4c808
...
...
@@ -20,6 +20,6 @@
-
else
%td
.old_line
%td
.new_line
%td
.line_content
{
class:
"#{line.type}"
}=
raw
diff_line_content
(
line
.
text
)
%td
.line_content
{
class:
"#{line.type}"
}=
diff_line_content
(
line
.
text
)
-
else
.nothing-here-block
No changes.
app/views/projects/diffs/_text_file.html.haml
View file @
80a4c808
...
...
@@ -22,7 +22,7 @@
=
link_to_new_diff_note
(
line_code
)
%td
.new_line
{
data:
{
linenumber:
line
.
new_pos
}}
=
link_to
raw
(
type
==
"old"
?
" "
:
line
.
new_pos
),
"#
#{
line_code
}
"
,
id:
line_code
%td
.line_content
{
class:
"noteable_line #{type} #{line_code}"
,
"line_code"
=>
line_code
}=
diff_line_content
(
line
.
text
)
.
html_safe
%td
.line_content
{
class:
"noteable_line #{type} #{line_code}"
,
"line_code"
=>
line_code
}=
diff_line_content
(
line
.
text
)
-
if
@reply_allowed
-
comments
=
@line_notes
.
select
{
|
n
|
n
.
line_code
==
line_code
&&
n
.
active?
}.
sort_by
(
&
:created_at
)
...
...
app/views/projects/notes/discussions/_diff.html.haml
View file @
80a4c808
...
...
@@ -24,7 +24,7 @@
=
raw
(
type
==
"new"
?
" "
:
line
.
old_pos
)
%td
.new_line
=
raw
(
type
==
"old"
?
" "
:
line
.
new_pos
)
%td
.line_content
{
class:
"noteable_line #{type} #{line_code}"
,
"line_code"
=>
line_code
}=
raw
diff_line_content
(
line
.
text
)
%td
.line_content
{
class:
"noteable_line #{type} #{line_code}"
,
"line_code"
=>
line_code
}=
diff_line_content
(
line
.
text
)
-
if
line_code
==
note
.
line_code
=
render
"projects/notes/diff_notes_with_reply"
,
notes:
discussion_notes
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