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
d6c037de
Unverified
Commit
d6c037de
authored
Jan 08, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont render README with markup if format is not compatible
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
03770698
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
application_helper.rb
app/helpers/application_helper.rb
+4
-0
_text.html.haml
app/views/projects/blob/_text.html.haml
+1
-1
_readme.html.haml
app/views/projects/tree/_readme.html.haml
+2
-2
_blob.html.haml
app/views/snippets/_blob.html.haml
+1
-1
No files found.
app/helpers/application_helper.rb
View file @
d6c037de
...
...
@@ -217,4 +217,8 @@ module ApplicationHelper
haml_tag
:script
,
"$('."
+
html_class
+
"').timeago().tooltip()"
end
.
html_safe
end
def
render_markup
(
file_name
,
file_content
)
GitHub
::
Markup
.
render
(
file_name
,
file_content
).
html_safe
end
end
app/views/projects/blob/_text.html.haml
View file @
d6c037de
...
...
@@ -4,7 +4,7 @@
=
markdown
(
blob
.
data
)
-
elsif
markup?
(
blob
.
name
)
.file-content.wiki
=
r
aw
GitHub
::
Markup
.
render
(
blob
.
name
,
blob
.
data
)
=
r
ender_markup
(
blob
.
name
,
blob
.
data
)
-
else
.file-content.code
-
unless
blob
.
empty?
...
...
app/views/projects/tree/_readme.html.haml
View file @
d6c037de
...
...
@@ -9,5 +9,5 @@
-
elsif
plain_text_readme?
(
readme
.
name
)
%pre
.clean
=
readme
.
data
-
els
e
=
r
aw
GitHub
::
Markup
.
render
(
readme
.
name
,
readme
.
data
)
-
els
if
markup?
(
readme
.
name
)
=
r
ender_markup
(
readme
.
name
,
readme
.
data
)
app/views/snippets/_blob.html.haml
View file @
d6c037de
...
...
@@ -15,7 +15,7 @@
=
markdown
(
@snippet
.
data
)
-
elsif
markup?
(
@snippet
.
file_name
)
.file-content.wiki
=
r
aw
GitHub
::
Markup
.
render
(
@snippet
.
file_name
,
@snippet
.
data
)
=
r
ender_markup
(
@snippet
.
file_name
,
@snippet
.
data
)
-
else
.file-content.code
%div
{
class:
user_color_scheme_class
}
...
...
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