Split and reformat markdown options and add refs to their docs.
Also add hard_wrap option.
This commit is contained in:
parent
58a581782b
commit
806695f491
1 changed files with 18 additions and 11 deletions
|
@ -54,17 +54,24 @@ module GitlabMarkdownHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def markdown(text)
|
def markdown(text)
|
||||||
@__renderer ||= Redcarpet::Markdown.new(Redcarpet::Render::GitlabHTML.new(self, filter_html: true, with_toc_data: true), {
|
unless @markdown
|
||||||
no_intra_emphasis: true,
|
gitlab_renderer = Redcarpet::Render::GitlabHTML.new(self,
|
||||||
tables: true,
|
# see https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch-
|
||||||
fenced_code_blocks: true,
|
filter_html: true,
|
||||||
autolink: true,
|
with_toc_data: true,
|
||||||
strikethrough: true,
|
hard_wrap: true)
|
||||||
lax_html_blocks: true,
|
@markdown ||= Redcarpet::Markdown.new(gitlab_renderer,
|
||||||
space_after_headers: true,
|
# see https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use
|
||||||
superscript: 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)
|
||||||
|
end
|
||||||
|
|
||||||
@__renderer.render(text).html_safe
|
@markdown.render(text).html_safe
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue