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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
3b40781e
Commit
3b40781e
authored
Jul 04, 2019
by
Vasiliy Yakliushin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract plain file rendering into a separate method
parent
22e2217c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
app/helpers/markup_helper.rb
app/helpers/markup_helper.rb
+7
-3
No files found.
app/helpers/markup_helper.rb
View file @
3b40781e
...
...
@@ -154,9 +154,7 @@ module MarkupHelper
elsif
asciidoc?
(
file_name
)
asciidoc_unsafe
(
text
,
context
)
elsif
plain?
(
file_name
)
content_tag
:pre
,
class:
'plain-readme'
do
text
end
plain_unsafe
(
text
)
else
other_markup_unsafe
(
file_name
,
text
,
context
)
end
...
...
@@ -271,6 +269,12 @@ module MarkupHelper
Gitlab
::
Asciidoc
.
render
(
text
,
context
)
end
def
plain_unsafe
(
text
)
content_tag
:pre
,
class:
'plain-readme'
do
text
end
end
def
other_markup_unsafe
(
file_name
,
text
,
context
=
{})
Gitlab
::
OtherMarkup
.
render
(
file_name
,
text
,
context
)
end
...
...
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