Merge branch 'use_redcarpet_for_markdown' of https://github.com/arthurschreiber/gitlabhq into arthurschreiber-use_redcarpet_for_markdown
Conflicts: Gemfile Gemfile.lock
This commit is contained in:
commit
9cb51c6ea2
7 changed files with 27 additions and 10 deletions
|
@ -22,7 +22,7 @@ td.linenos{
|
|||
vertical-align:top;
|
||||
}
|
||||
|
||||
.highlight{
|
||||
.highlighttable .highlight{
|
||||
background:none;
|
||||
padding:10px 0px 0px 10px;
|
||||
margin-left:0px;
|
||||
|
@ -31,7 +31,7 @@ td.linenos{
|
|||
}
|
||||
|
||||
.linenodiv pre,
|
||||
.highlight pre{
|
||||
.highlighttable .highlight pre{
|
||||
margin:0;
|
||||
padding:0;
|
||||
background:none;
|
||||
|
|
|
@ -72,7 +72,18 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def markdown(text)
|
||||
RDiscount.new(text, :autolink, :no_pseudo_protocols, :safelink, :smart, :filter_html).to_html.html_safe
|
||||
@__renderer ||= Redcarpet::Markdown.new(Redcarpet::Render::GitlabHTML.new(filter_html: true), {
|
||||
no_intra_emphasis: true,
|
||||
tables: true,
|
||||
fenced_code_blocks: true,
|
||||
autolink: true,
|
||||
strikethrough: true,
|
||||
lax_html_blocks: true,
|
||||
space_after_headers: true,
|
||||
superscript: true
|
||||
})
|
||||
|
||||
@__renderer.render(text).html_safe
|
||||
end
|
||||
|
||||
def search_autocomplete_source
|
||||
|
|
|
@ -1,5 +1,2 @@
|
|||
module WikisHelper
|
||||
def markdown_to_html(text)
|
||||
RDiscount.new(text).to_html.html_safe
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
%hr
|
||||
.wiki_content
|
||||
= preserve do
|
||||
= markdown_to_html @wiki.content
|
||||
= markdown @wiki.content
|
||||
|
||||
%p.time Last edited by #{@wiki.user.name}, in #{time_ago_in_words @wiki.created_at}
|
||||
- if can? current_user, :admin_wiki, @project
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue