Commit 806695f4 authored by Riyad Preukschas's avatar Riyad Preukschas

Split and reformat markdown options and add refs to their docs.

Also add hard_wrap option.
parent 58a58178
...@@ -54,7 +54,14 @@ module GitlabMarkdownHelper ...@@ -54,7 +54,14 @@ 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
gitlab_renderer = Redcarpet::Render::GitlabHTML.new(self,
# see https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch-
filter_html: true,
with_toc_data: true,
hard_wrap: true)
@markdown ||= Redcarpet::Markdown.new(gitlab_renderer,
# see https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use
no_intra_emphasis: true, no_intra_emphasis: true,
tables: true, tables: true,
fenced_code_blocks: true, fenced_code_blocks: true,
...@@ -62,9 +69,9 @@ module GitlabMarkdownHelper ...@@ -62,9 +69,9 @@ module GitlabMarkdownHelper
strikethrough: true, strikethrough: true,
lax_html_blocks: true, lax_html_blocks: true,
space_after_headers: true, space_after_headers: true,
superscript: true superscript: true)
}) end
@__renderer.render(text).html_safe @markdown.render(text).html_safe
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment