summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-08 15:13:13 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-08 15:13:13 +0000
commitc307fd22ea6a7c6bbaca8d28649ce8f178e3219c (patch)
treea338c489505cc5f8073c55da0be9eb8d63503f69
parent449a8eb95c430bab63430a531b36a2211c7ea69c (diff)
parentd6c037de81096680db07397a44a0824355c703c8 (diff)
downloadgitlab-ce-c307fd22ea6a7c6bbaca8d28649ce8f178e3219c.tar.gz
Merge branch 'xss/readme' of /home/git/repositories/gitlab/gitlabhq
-rw-r--r--app/helpers/application_helper.rb4
-rw-r--r--app/views/projects/blob/_text.html.haml2
-rw-r--r--app/views/projects/tree/_readme.html.haml4
-rw-r--r--app/views/snippets/_blob.html.haml2
4 files changed, 8 insertions, 4 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index cd3afd5cc32..0db43fa1809 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -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
diff --git a/app/views/projects/blob/_text.html.haml b/app/views/projects/blob/_text.html.haml
index bed493d6d8c..d03b53888ae 100644
--- a/app/views/projects/blob/_text.html.haml
+++ b/app/views/projects/blob/_text.html.haml
@@ -4,7 +4,7 @@
= markdown(blob.data)
- elsif markup?(blob.name)
.file-content.wiki
- = raw GitHub::Markup.render(blob.name, blob.data)
+ = render_markup(blob.name, blob.data)
- else
.file-content.code
- unless blob.empty?
diff --git a/app/views/projects/tree/_readme.html.haml b/app/views/projects/tree/_readme.html.haml
index 1fccfbc1645..ab572f2e97b 100644
--- a/app/views/projects/tree/_readme.html.haml
+++ b/app/views/projects/tree/_readme.html.haml
@@ -9,5 +9,5 @@
- elsif plain_text_readme?(readme.name)
%pre.clean
= readme.data
- - else
- = raw GitHub::Markup.render(readme.name, readme.data)
+ - elsif markup?(readme.name)
+ = render_markup(readme.name, readme.data)
diff --git a/app/views/snippets/_blob.html.haml b/app/views/snippets/_blob.html.haml
index e0152143a95..e6ae33f38f3 100644
--- a/app/views/snippets/_blob.html.haml
+++ b/app/views/snippets/_blob.html.haml
@@ -15,7 +15,7 @@
= markdown(@snippet.data)
- elsif markup?(@snippet.file_name)
.file-content.wiki
- = raw GitHub::Markup.render(@snippet.file_name, @snippet.data)
+ = render_markup(@snippet.file_name, @snippet.data)
- else
.file-content.code
%div{class: user_color_scheme_class}