Skip to content
Snippets Groups Projects
Commit c52bc838 authored by Takao Baba's avatar Takao Baba Committed by Takao Baba
Browse files

Enable markdown formatting for snippets in projects.

parent c5732658
No related branches found
No related tags found
1 merge request!6231Enable markdown formatting for snippets in projects.
Loading
Loading
@@ -6,9 +6,5 @@
.btn-group.tree-btn-group.pull-right
- if can?(current_user, :admin_project_snippet, @project) || @snippet.author == current_user
= link_to "Edit", edit_project_snippet_path(@project, @snippet), class: "btn btn-tiny", title: 'Edit Snippet'
= link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn btn-tiny", target: "_blank"
.file-content.code
- unless @snippet.content.empty?
= render 'shared/file_hljs', blob: @snippet
- else
%p.nothing_here_message Empty file
= link_to "Raw", raw_project_snippet_path(@project, @snippet), class: "btn btn-tiny", target: "_blank"
= render 'snippets/blob_content'
Loading
Loading
@@ -8,17 +8,4 @@
= link_to "Edit", edit_snippet_path(@snippet), class: "btn btn-tiny", title: 'Edit Snippet'
= link_to "Delete", snippet_path(@snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-tiny", title: 'Delete Snippet'
= link_to "Raw", raw_snippet_path(@snippet), class: "btn btn-tiny", target: "_blank"
- unless @snippet.content.empty?
- if gitlab_markdown?(@snippet.file_name)
.file-content.wiki
= preserve do
= markdown(@snippet.data)
- elsif markup?(@snippet.file_name)
.file-content.wiki
= render_markup(@snippet.file_name, @snippet.data)
- else
.file-content.code
= render 'shared/file_hljs', blob: @snippet
- else
.file-content.code
%p.nothing_here_message Empty file
= render 'snippets/blob_content'
- unless @snippet.content.empty?
- if gitlab_markdown?(@snippet.file_name)
.file-content.wiki
= preserve do
= markdown(@snippet.data)
- elsif markup?(@snippet.file_name)
.file-content.wiki
= render_markup(@snippet.file_name, @snippet.data)
- else
.file-content.code
= render 'shared/file_hljs', blob: @snippet
- else
.file-content.code
%p.nothing_here_message Empty file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment