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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0e524aae
Commit
0e524aae
authored
Sep 20, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added workaround for github-markup issue with rendering markdown
parent
ed899a2f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
app/helpers/tree_helper.rb
app/helpers/tree_helper.rb
+6
-2
app/views/refs/_tree.html.haml
app/views/refs/_tree.html.haml
+5
-1
app/views/refs/_tree_file.html.haml
app/views/refs/_tree_file.html.haml
+5
-1
No files found.
app/helpers/tree_helper.rb
View file @
0e524aae
...
@@ -32,7 +32,11 @@ module TreeHelper
...
@@ -32,7 +32,11 @@ module TreeHelper
#
#
# Returns boolean
# Returns boolean
def
markup?
(
filename
)
def
markup?
(
filename
)
filename
.
end_with?
(
*
%w(.
mdown .md .markdown .
textile .rdoc .org .creole
filename
.
end_with?
(
*
%w(.textile .rdoc .org .creole
.mediawiki .rst .asciidoc .pod)
)
.mediawiki .rst .asciidoc .pod)
)
end
end
def
gitlab_markdown?
(
filename
)
filename
.
end_with?
(
*
%w(.mdown .md .markdown)
)
end
end
end
app/views/refs/_tree.html.haml
View file @
0e524aae
...
@@ -43,6 +43,10 @@
...
@@ -43,6 +43,10 @@
%i
.icon-file
%i
.icon-file
=
content
.
name
=
content
.
name
.file_content.wiki
.file_content.wiki
-
if
gitlab_markdown?
(
content
.
name
)
=
preserve
do
=
markdown
(
content
.
data
)
-
else
=
raw
GitHub
::
Markup
.
render
(
content
.
name
,
content
.
data
)
=
raw
GitHub
::
Markup
.
render
(
content
.
name
,
content
.
data
)
:javascript
:javascript
...
...
app/views/refs/_tree_file.html.haml
View file @
0e524aae
...
@@ -9,7 +9,11 @@
...
@@ -9,7 +9,11 @@
=
link_to
"history"
,
project_commits_path
(
@project
,
path:
params
[
:path
],
ref:
@ref
),
class:
"btn very_small"
=
link_to
"history"
,
project_commits_path
(
@project
,
path:
params
[
:path
],
ref:
@ref
),
class:
"btn very_small"
=
link_to
"blame"
,
blame_file_project_ref_path
(
@project
,
@ref
,
path:
params
[
:path
]),
class:
"btn very_small"
=
link_to
"blame"
,
blame_file_project_ref_path
(
@project
,
@ref
,
path:
params
[
:path
]),
class:
"btn very_small"
-
if
file
.
text?
-
if
file
.
text?
-
if
markup?
(
name
)
-
if
gitlab_markdown?
(
name
)
.file_content.wiki
=
preserve
do
=
markdown
(
file
.
data
)
-
elsif
markup?
(
name
)
.file_content.wiki
.file_content.wiki
=
raw
GitHub
::
Markup
.
render
(
name
,
file
.
data
)
=
raw
GitHub
::
Markup
.
render
(
name
,
file
.
data
)
-
else
-
else
...
...
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