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
310c3b21
Commit
310c3b21
authored
Apr 24, 2017
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Single quotes in MarkupHelper where possible
parent
4f2d6b3e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
markup_helper.rb
app/helpers/markup_helper.rb
+9
-9
No files found.
app/helpers/markup_helper.rb
View file @
310c3b21
...
@@ -27,7 +27,7 @@ module MarkupHelper
...
@@ -27,7 +27,7 @@ module MarkupHelper
# explicitly produce the correct linking behavior (i.e.
# explicitly produce the correct linking behavior (i.e.
# "<a>outer text </a><a>gfm ref</a><a> more outer text</a>").
# "<a>outer text </a><a>gfm ref</a><a> more outer text</a>").
def
link_to_gfm
(
body
,
url
,
html_options
=
{})
def
link_to_gfm
(
body
,
url
,
html_options
=
{})
return
""
if
body
.
blank?
return
''
if
body
.
blank?
context
=
{
context
=
{
project:
@project
,
project:
@project
,
...
@@ -70,7 +70,7 @@ module MarkupHelper
...
@@ -70,7 +70,7 @@ module MarkupHelper
end
end
def
markdown
(
text
,
context
=
{})
def
markdown
(
text
,
context
=
{})
return
""
unless
text
.
present?
return
''
unless
text
.
present?
context
[
:project
]
||=
@project
context
[
:project
]
||=
@project
html
=
context
.
delete
(
:rendered
)
||
markdown_unsafe
(
text
,
context
)
html
=
context
.
delete
(
:rendered
)
||
markdown_unsafe
(
text
,
context
)
...
@@ -79,7 +79,7 @@ module MarkupHelper
...
@@ -79,7 +79,7 @@ module MarkupHelper
def
markdown_field
(
object
,
field
)
def
markdown_field
(
object
,
field
)
object
=
object
.
for_display
if
object
.
respond_to?
(
:for_display
)
object
=
object
.
for_display
if
object
.
respond_to?
(
:for_display
)
return
""
unless
object
.
present?
return
''
unless
object
.
present?
html
=
Banzai
.
render_field
(
object
,
field
)
html
=
Banzai
.
render_field
(
object
,
field
)
banzai_postprocess
(
html
,
object
.
banzai_render_context
(
field
))
banzai_postprocess
(
html
,
object
.
banzai_render_context
(
field
))
...
@@ -93,7 +93,7 @@ module MarkupHelper
...
@@ -93,7 +93,7 @@ module MarkupHelper
def
render_wiki_content
(
wiki_page
)
def
render_wiki_content
(
wiki_page
)
text
=
wiki_page
.
content
text
=
wiki_page
.
content
return
""
unless
text
.
present?
return
''
unless
text
.
present?
context
=
{
pipeline: :wiki
,
project:
@project
,
project_wiki:
@project_wiki
,
page_slug:
wiki_page
.
slug
}
context
=
{
pipeline: :wiki
,
project:
@project
,
project_wiki:
@project_wiki
,
page_slug:
wiki_page
.
slug
}
...
@@ -111,7 +111,7 @@ module MarkupHelper
...
@@ -111,7 +111,7 @@ module MarkupHelper
end
end
def
markup_unsafe
(
file_name
,
text
,
context
=
{})
def
markup_unsafe
(
file_name
,
text
,
context
=
{})
return
""
unless
text
.
present?
return
''
unless
text
.
present?
if
gitlab_markdown?
(
file_name
)
if
gitlab_markdown?
(
file_name
)
Hamlit
::
RailsHelpers
.
preserve
(
markdown_unsafe
(
text
,
context
))
Hamlit
::
RailsHelpers
.
preserve
(
markdown_unsafe
(
text
,
context
))
...
@@ -213,10 +213,10 @@ module MarkupHelper
...
@@ -213,10 +213,10 @@ module MarkupHelper
end
end
def
markdown_toolbar_button
(
options
=
{})
def
markdown_toolbar_button
(
options
=
{})
data
=
options
[
:data
].
merge
({
container:
"body"
})
data
=
options
[
:data
].
merge
({
container:
'body'
})
content_tag
:button
,
content_tag
:button
,
type:
"button"
,
type:
'button'
,
class:
"toolbar-btn js-md has-tooltip hidden-xs"
,
class:
'toolbar-btn js-md has-tooltip hidden-xs'
,
tabindex:
-
1
,
tabindex:
-
1
,
data:
data
,
data:
data
,
title:
options
[
:title
],
title:
options
[
:title
],
...
@@ -227,7 +227,7 @@ module MarkupHelper
...
@@ -227,7 +227,7 @@ module MarkupHelper
# Calls Banzai.post_process with some common context options
# Calls Banzai.post_process with some common context options
def
banzai_postprocess
(
html
,
context
=
{})
def
banzai_postprocess
(
html
,
context
=
{})
return
""
unless
html
.
present?
return
''
unless
html
.
present?
context
.
merge!
(
context
.
merge!
(
current_user:
(
current_user
if
defined?
(
current_user
)),
current_user:
(
current_user
if
defined?
(
current_user
)),
...
...
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