summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2015-05-13 01:54:13 +0200
committerJakub Jirutka <jakub@jirutka.cz>2015-05-18 22:52:13 +0200
commitb0659c1b072267e0e1fa3066ca1a8cc17bc8f6c0 (patch)
tree54701d5d517061602ff5ac58512268f4c18a105a /app/views
parentdaa0925016a63dcde448643cbf1310aca359cf37 (diff)
downloadgitlab-ce-b0659c1b072267e0e1fa3066ca1a8cc17bc8f6c0.tar.gz
Simplify and unify helpers for rendering markup
Diffstat (limited to 'app/views')
-rw-r--r--app/views/projects/blob/_text.html.haml6
-rw-r--r--app/views/search/results/_snippet_blob.html.haml11
-rw-r--r--app/views/shared/snippets/_blob.html.haml6
3 files changed, 3 insertions, 20 deletions
diff --git a/app/views/projects/blob/_text.html.haml b/app/views/projects/blob/_text.html.haml
index f6bd62f239b..4429c395aee 100644
--- a/app/views/projects/blob/_text.html.haml
+++ b/app/views/projects/blob/_text.html.haml
@@ -1,8 +1,4 @@
-- if gitlab_markdown?(blob.name)
- .file-content.wiki
- = preserve do
- = markdown(blob.data)
-- elsif markup?(blob.name)
+- if markup?(blob.name)
.file-content.wiki
= render_markup(blob.name, blob.data)
- else
diff --git a/app/views/search/results/_snippet_blob.html.haml b/app/views/search/results/_snippet_blob.html.haml
index 8af393777f0..95099853918 100644
--- a/app/views/search/results/_snippet_blob.html.haml
+++ b/app/views/search/results/_snippet_blob.html.haml
@@ -13,16 +13,7 @@
.file-title
%i.fa.fa-file
%strong= snippet_blob[:snippet_object].file_name
- - if gitlab_markdown?(snippet_blob[:snippet_object].file_name)
- .file-content.wiki
- - snippet_blob[:snippet_chunks].each do |snippet|
- - unless snippet[:data].empty?
- = preserve do
- = markdown(snippet[:data])
- - else
- .file-content.code
- .nothing-here-block Empty file
- - elsif markup?(snippet_blob[:snippet_object].file_name)
+ - if markup?(snippet_blob[:snippet_object].file_name)
.file-content.wiki
- snippet_blob[:snippet_chunks].each do |snippet|
- unless snippet[:data].empty?
diff --git a/app/views/shared/snippets/_blob.html.haml b/app/views/shared/snippets/_blob.html.haml
index 30458793fd1..d26a99bb14c 100644
--- a/app/views/shared/snippets/_blob.html.haml
+++ b/app/views/shared/snippets/_blob.html.haml
@@ -1,9 +1,5 @@
- unless @snippet.content.empty?
- - if gitlab_markdown?(@snippet.file_name)
- .file-content.wiki
- = preserve do
- = markdown(@snippet.data)
- - elsif markup?(@snippet.file_name)
+ - if markup?(@snippet.file_name)
.file-content.wiki
= render_markup(@snippet.file_name, @snippet.data)
- else