Use Gitlab Markdown for Markdown files and Gollum to render the rest.
This commit enables the usage of the Gitlab Markdown post processing on all Markdown formatted files. For file types that do not contain Markdown, it defaults to the Gollum native renderer to process the content.
This commit is contained in:
parent
f0aa54e0fb
commit
7665b1de7e
3 changed files with 33 additions and 1 deletions
|
@ -49,4 +49,12 @@ module GitlabMarkdownHelper
|
|||
|
||||
@markdown.render(text).html_safe
|
||||
end
|
||||
|
||||
def render_wiki_content(wiki_page)
|
||||
if wiki_page.format == :markdown
|
||||
markdown(wiki_page.content)
|
||||
else
|
||||
wiki_page.formatted_content.html_safe
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
.file_holder
|
||||
.file_content.wiki
|
||||
= preserve do
|
||||
= @wiki.formatted_content.html_safe
|
||||
= render_wiki_content(@wiki)
|
||||
|
||||
- commit = CommitDecorator.new(@wiki.version)
|
||||
%p.time Last edited by #{commit.author_link(avatar: true, size: 16)} #{time_ago_in_words @wiki.created_at} ago
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue